S = input() M = input() if sorted(S)== sorted(M): print ("YES") else: print ("NO")