A = input() B = input() if sorted(A) == sorted(B): print("Yes") else: print("No")