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