#K56177. Anagram Check

    ID: 30141 Type: Default 1000ms 256MiB

Anagram Check

Anagram Check

Given two words, determine if they are anagrams of each other. Two words are anagrams if and only if they consist of the same characters (order does not matter), and the comparison is case-sensitive. Formally, for two words \(w_1\) and \(w_2\), they are anagrams if \[ sorted(w_1) = sorted(w_2) \]

For example, "listen" and "silent" are anagrams while "hello" and "billion" are not.

inputFormat

The input consists of two lines. The first line contains the word (w_1) and the second line contains the word (w_2). Both words can consist of any characters. Note that the comparison is case-sensitive.

outputFormat

Output a single line containing "YES" if the two given words are anagrams of each other; otherwise, output "NO".## sample

listen
silent
YES

</p>