l=lambda:sorted(raw_input()) print["NO","YES"][l()==l()]