import Control.Monad

stripFromPic :: [String] -> Int -> Int -> [String]
stripFromPic pic x y = map (drop x) $ drop y pic

main :: IO ()
main = do
    [n, m] <- map (read :: String -> Int) <$> words <$> getLine
    pic <- replicateM n getLine
    tmpl <- replicateM m getLine
    let strip = stripFromPic pic
    let a = strip <$> [0..n-m] <*> [0..n-m]
    putStrLn $ if any (== tmpl) a then "Yes" else "No"