A = list(input()) B = list(input()) if set(A) == set(B): print("YES") else: print("NO")