print("YNEOS"[tuple(sorted(list(input()))) != tuple(sorted(list(input()))) :: 2])