import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines A,B = read().split() answer = 'YES' if sorted(A) == sorted(B) else 'NO' print(answer)