S=[input() for i in [0,1]] print("YES"if set(S[0])==set(S[1]) else"NO")