a = gets.chomp b = gets.chomp puts a.each_char.sort == b.each_char.sort ? :YES : :NO