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