A = input() B = input() if sorted(list(A)) == sorted(list(B)): print('YES') else: print('NO')