a = sorted(input())
b = sorted(input())

if a == b:
    ans = "YES"
else:
    ans = "NO"

print(ans)