a = gets.chomp.chars b = gets.chomp.chars if a.tally == b.tally puts "YES" else puts "NO" end