a = list(input())
b = input()
c = ""
for i in range(len(a)):
    b = b.replace(a[i], "", 1)
if b == c:
    print("YES")
else:
    print("NO")