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