n, m = gets.split.map(&:to_i)
ary = n.times.map{gets.chomp}
msg = "NO"
ary.each { msg = "YES" if _1.include? "LOVE" }
puts msg