import sys input=lambda:sys.stdin.readline().rstrip() print(['NO','YES'][sorted(input())==sorted(input())])