Search across blog, articles, projects, courses, and community posts
Two words are anagrams if one can be rearranged into the other, using every letter exactly once. Read two words and print YES if they are anagrams, otherwise NO.
Input: two lines, one word each.
Output: YES or NO.
Each word has 1 to 1000 lowercase letters.
listen silent
YES
apple pale
NO