def love(params) !params.index('LOVE').nil? ? 'YES' : 'NO' end strs = [] num = gets.split(' ').first.to_i p "num = #{num}" num.times.each do strs << gets end puts love(strs.to_s)