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