A=list(input()) B=list(input()) A.sort() B.sort() if A==B: print("Yes") else: print("No")