import Control.Monad
import Data.List

main = do
    [n,m] <- map read . words <$> getLine
    a <- replicateM n getLine
    b <- replicateM m getLine
    putStrLn $ if null [()| a' <- tails a, a'' <- transpose (tails (transpose a')), check a'' b] then "No" else "Yes"

check x y = and $ zipWith (\a b -> b `isPrefixOf` a) x y