line = gets.split.map(&:to_i).first result = "" line.times do if gets.chomp.include?("LOVE") result = "YES" else result = "NO" end end puts result