import Control.Applicative ((<$>)) import Control.Monad (replicateM) import Data.List (isInfixOf) import Data.Bool (bool) main :: IO () main = do [n, _] <- map read <$> words <$> getLine solve <$> replicateM n getLine >>= putStrLn solve :: [String] -> String solve = bool "NO" "YES" . any f where f s = "LOVE" `isInfixOf` s