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