a = input().strip() b = input().strip() if set(a) == set(b): print("YES") else: print("NO")