Question
String Scramble Check
In a quiet classroom, you had diligently written down M identical strings, each with a length of N, on the whiteboard. However, when you returned, you found that your archenemy had replaced all M strings with a single, longer string of length M × N. He claims that this new string is merely a jumble of the original M strings. Skeptical of his story, you decide to investigate whether his assertion holds true. Can you determine if the new string is indeed a valid rearrangement of the original strings?
Input
The first line of the input contains 2 space-separated integers N and M.
The next line of the input contains a string of length N*M.
Constraint
1 ≤ N*M ≤ 105
A string of length N*M having lowercase english alphabets.
The next line of the input contains a string of length N*M.
Constraint
1 ≤ N*M ≤ 105
A string of length N*M having lowercase english alphabets.
Output
Print (without quotes) "YES" if your friend is telling the truth, else print "NO".
Example
Sample Input
3 2
abccab
Sample Output
YES
Explaination
You had written string "abc" twice one the board which when shuffled gives string abccab.
3 2
abccab
Sample Output
YES
Explaination
You had written string "abc" twice one the board which when shuffled gives string abccab.