Johnny is a three years old kid. He likes to eat sugar. One day, he sneaked into the kitchen in order to grab some sugar to eat. Unfortunately, his papa catched him.
His papa called him: " Johnny, Johnny! "
Johnny replied: " Yes, papa. "
papa then asked: " Eating sugar? "
Johnny lied: " No, papa. "
At that moment, Johnny began to think that what's defintion of string equivalent?
Johnny thinks that string a and string b is equivalent if a and b are the same or string a and string b can be devided into two same size part: a1, a2, b1, b2 and the following rules fulfill:
( ( a1 == b1 ) && ( a2 == b2 ) ) or ( ( a1 == b2 ) && ( a2 == b1 ) )
In above sentence, "==" means whether a and b are the same or string a and string b can be devided into two same size part: a1, a2, b1, b2 and the following rules fulfill: ( ( a1 == b1 ) && ( a2 == b2 ) ) or ( ( a1 == b2 ) && ( a2 == b1 ) ). You can consider this equal definition as a recursion.
For example:
a = " papa ", b = " apap ", we need to check if " pa " equals " ap " in Johnny ' s rule.
Therefore, we divide " pa " into "p" and "a", and divide "ap" into "a" and "p".
Then, because "p" == "p" && " a " == "a", we know that "pa" == "ap".
Hence, we can conclude that " papa " equals " apap ".
Note that we can't divide a string if the length of the string is an odd number.
Help Johnny find out whether the two string are the same. If you help him, he will give you some sugar.
input contains two lines.
First line is the string a.
Second line is the string b.
the length of the two string are the same and the length is from 1~105 ( 1 <= length <= 105 )
output contains one line.
print "YES" if two string is equal in Johnny's rule,
print "NO" otherwise.
remember to print \n at the end of output.