import std; void main() { auto A = readln.strip.to!(dchar[]); auto B = readln.strip.to!(dchar[]); (A.sort == B.sort ? "YES" : "NO").writeln; }