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