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