h = Hash.new(0) gets.chomp.chars{|c|h[c]+=1} gets.chomp.chars{|c|h[c]-=1} puts (h.values.all?{|t|t==0})? "YES" : "NO"