#K6666. Anagram Checker
Anagram Checker
Anagram Checker
Given two strings s1
and s2
, determine if they are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of another, using all the original letters exactly once.
Constraints:
- 1 ≤ length of s1, s2 ≤ 1,000,000
- s1 and s2 consist of only lowercase English letters.
The input is provided via standard input and the output should be printed to standard output.
inputFormat
The input consists of two lines:
- The first line contains the string
s1
. - The second line contains the string
s2
.
outputFormat
Output YES
if the two strings are anagrams of each other, otherwise output NO
.
listen
silent
YES