main=do
  [n,m]<-map read.words<$>getLine
  buf<-lines<$>getContents
  let a=take n buf
  let b=drop n buf
  putStrLn$if (length[1|i<-[0..n-m],j<-[0..n-m],f m i j a b])>0 then"Yes"else"No"
f m i j a b=(length[1|k<-[0..m-1],l<-[0..m-1],(a!!(i+k)!!(j+l))==(b!!k!!l)])==m^2
