A = sorted(list(str(x) for x in str(input()))) B = sorted(list(str(x) for x in str(input()))) print('YES' if A == B else 'NO')