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