A = ''.join(sorted(list(input()))) B = ''.join(sorted(list(input()))) if A == B: print("YES") else: print("NO")