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