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