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