listen silent
YES
a = input().strip() b = input().strip() print('YES' if sorted(a) == sorted(b) else 'NO')