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