A = input().sort() B = input().sort() if A == B: print("YES") else: print("NO")