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