#K44782. Anagram Checker

    ID: 27608 Type: Default 1000ms 256MiB

Anagram Checker

Anagram Checker

Given two strings (S_1) and (S_2), determine whether they are anagrams. Two strings are anagrams if after sorting their characters they become identical, i.e. (\text{sort}(S_1) = \text{sort}(S_2)). The input consists of two lines, each containing a string. The output should be the string "YES" if the two strings are anagrams, and "NO" otherwise.

inputFormat

The input is read from standard input (stdin) and consists of exactly two lines. The first line contains the first string (S_1) and the second line contains the second string (S_2). The strings will not contain spaces.

outputFormat

Output to standard output (stdout) the string "YES" if the given strings are anagrams, or "NO" if they are not.## sample

listen
silent
YES

</p>