#C6934. Anagram Checker

    ID: 50749 Type: Default 1000ms 256MiB

Anagram Checker

Anagram Checker

Given two words, determine if they are anagrams of each other. Two words are anagrams if the letters of one word can be rearranged to form the other word.

For example, the words listen and silent are anagrams because if you sort their characters, both become eilnst.

Formally, if you denote the sorted version of a string \(s\) as \(sorted(s)\), then two words \(word1\) and \(word2\) are anagrams if:

\(sorted(word1) = sorted(word2)\)

Your task is to write a program that reads multiple test cases from standard input and outputs whether each pair of words are anagrams.

inputFormat

The input begins with an integer \(T\) (number of test cases). Each of the next \(T\) lines contains two strings separated by a space.

outputFormat

For each test case, output a single line containing "YES" if the two words are anagrams, otherwise output "NO".

## sample
4
listen silent
triangle integral
apple ppal
rat tar
YES

YES NO YES

</p>