~/algor $ cat problems/string-anagramma
Anagram?
Medium
1000 ms
128 MB
46%
Two words $a$ and $b$ of lowercase Latin letters are given. They are anagrams if $b$ can be made by rearranging the letters of $a$ (using each exactly once). Determine whether the words are anagrams.
Input
The first line contains $a$, the second line $b$.
Output
YES if they are anagrams, otherwise NO.
Note
$1 \le |a|, |b| \le 10^{5}$
$a$ and $b$ consist of lowercase Latin letters only
Examples
Input #1
listen silent
Output #1
YES
Input #2
abc abd
Output #2
NO