A, B = [input() for _ in range(2)] if sorted(A) == sorted(B): print("YES") else: print("NO")