A = input() B = input() for i in A: if B.count(i) == A.count(i): K = 'YES' else: K = 'NO' break print(K)