import Control.Monad( replicateM)
import Data.List( transpose)
main = do
    [n_, m_] <- return . map read . words =<< getLine
    alines_ <- replicateM n_ getLine
    blines_ <- replicateM m_ getLine
    let
	trimC n als = map (drop n) als
	trimR n als = drop n als
	trimTop [bl] = [bl]
	trimTop thru@(bl:bls)
	  | all ('.'==) bl = trimTop bls
	  | otherwise	    = thru
	trimBottom bls = reverse . trimTop $ reverse bls
	trimLR = transpose . trimBottom . trimTop . transpose 
	cleanse = trimLR . trimBottom . trimTop
	blines'@(b':_) = cleanse blines_
	mr = length blines'
	mc = length b'
	trims = [trimR tr.trimC tc$alines_| tc<-[0..n_-mc], tr<-[0..n_-mr]] 
    putStr $ if	any (blines'===) trims
	then "Yes"
	else "No"
      where
	bls === trim = let
	    (b,t) = unzip $ zip bls trim
	  in
	    b==t