print "YES" if sorted(raw_input()) == sorted(raw_input()) else "NO"