import Control.Monad

main :: IO ()
main = do
    [n, m] <- map (read :: String -> Int) <$> words <$> getLine
    pic <- replicateM n getLine
    tmpl <- replicateM m getLine
    a <- forM [0..n-m] $ \i -> do
        let stripped = map (drop i) (drop i pic)
        pure $ stripped == tmpl
    putStrLn $ if any id a then "Yes" else "No"