f = lambda:''.join(sorted(input())) print('YES' if f()==f() else 'NO')