A="".join(sorted(raw_input()));B="".join(sorted(raw_input())); if (A == B): print "YES" else: print "NO"