e,s,l=input,sorted print(['NO','YES'][s(e())==s(e())])