A = input() B = input() print("YES") if sorted(A) == sorted(B) else print("NO")