if sorted(input())==sorted(input()): print("YES") else: print("NO")