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