A = input() B = input() if list(A).sort() == list(B).sort(): print("YES") else: print("NO")