n = gets.split.map(&:to_i).first (1..n).each do |num| if gets.include?("LOVE") puts "YES" break elsif num == n puts "NO" end end