import Data.List

main :: IO ()
main = do
  (n:m:_) <- getLine >>= return . map read . words :: IO [Int]
  lines <- getContents >>= return . lines :: IO [String]

  putStrLn $ if (or $ map f lines) then "YES" else "NO"

  where
    f [] = False
    f str@(_:xs) = if isPrefixOf "LOVE" str then True else f xs