from asyncio.windows_events import NULL A = sorted(list(input())) B = sorted(list(input())) print('YES' if A == B else 'NO')