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