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