#K38082. Anagram Checker

    ID: 26119 Type: Default 1000ms 256MiB

Anagram Checker

Anagram Checker

You are given two strings per test case. Your task is to determine whether the two strings are anagrams of each other. Two strings are anagrams if and only if they consist of the same characters with the same frequencies (order does not matter). For example, listen and silent are anagrams.

Formally, for two strings \( s_1 \) and \( s_2 \), they are anagrams if \[ \text{sort}(s_1) = \text{sort}(s_2), \] where \( \text{sort}(s) \) denotes the string obtained after sorting all characters of \( s \) in non-decreasing order.

The input begins with a single integer indicating the number of test cases. Each test case consists of two strings in separate lines. For each test case, output "Yes" if the strings are anagrams, otherwise output "No".

inputFormat

The first line of input contains a single integer \( T \) which denotes the number of test cases. \( T \) test cases follow. Each test case consists of two lines, each containing a string. The strings will not contain spaces.

outputFormat

For each test case, print a single line containing either "Yes" if the two strings are anagrams of each other, or "No" otherwise.

## sample
3
listen
silent
triangle
integral
apple
happy
Yes

Yes No

</p>