f=lambda:sorted(input()) print(['NO','YES'][f() == f()])