q = input().split("\n") q0 = list(q[0]) q1 = list(q[1]) q0.sort() q1.sort() if q0 == q1: print("YES") else: print("NO")