#C83. Anagram Checker
Anagram Checker
Anagram Checker
Given two strings, determine if they are anagrams of each other. Two strings are anagrams if one string can be rearranged to form the other. Formally, let \(s_1\) and \(s_2\) be the two strings. They are anagrams if:
\(sorted(s_1) = sorted(s_2)\)
where sorted(s)
denotes the string formed by the characters of s
arranged in non-decreasing order.
Input will be provided via standard input and output should be printed to standard output. Your program should read two strings, separated by whitespace, and print Yes
if they are anagrams and No
otherwise.
inputFormat
The input consists of a single line containing two space-separated strings \(s_1\) and \(s_2\). Both strings are non-empty and contain only lowercase English letters.
outputFormat
Output a single line containing either Yes
if the two strings are anagrams of each other, or No
otherwise.
listen silent
Yes