#文字を自由に並び替え A = list(input()) B = list(input()) A.sort() B.sort() if A == B: print("YES") else: print("NO")