Anagram Check
Completed
Read two words and print YES if they are anagrams (same letters, same counts, ignoring case), else NO.
Input
Two lines.
Output
YES or NO
Example
Input
Listen Silent
Output
YES
Editor
Python
Hints
sorted(word) returns the letters in order.
A set would lose the letter counts - aab vs abb.
Solution explanation
Sorting the letters gives a canonical form; equal forms mean anagrams.
Show solution
a = input().lower()
b = input().lower()
print("YES" if sorted(a) == sorted(b) else "NO")