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