A = [0] * 26 B = [0] * 26 for i in input(): A[ord(i) - 97] += 1 for i in input(): B[ord(i) - 97] += 1 if A == B: print('YES') else: print('NO')