a,b = sorted(input()),sorted(input()) print("YES" if a==b else "NO")