#118Easy
Anagram
Time: 1 s · Memory: 256 MB
- Maps and sets
Statement
You are given two words. Are they anagrams, i.e. is one obtained from the other by rearranging its letters? For example, listen and silent are anagrams.
Input format
Two lines with two words of lowercase Latin letters, each of length to .
Output format
YES if they are anagrams, NO otherwise.
Examples
Input
listen silent
Output
YES
Input
salom molas
Output
YES
Note
Every letter must occur the same number of times in both words. Count the letters with a dictionary (or counters): for the first word, for the second; if all are zero at the end, they are anagrams. If the lengths differ, the answer is NO right away.
