
object MainKt {
  @JvmStatic fun main(args:Array<String>) {
   val (N,M)=readLine()!!.split(" ").map {it.toInt()}
   val Ai:Array<String> =Array(N) {readLine()!!}
   val Bi:Array<String> =Array(M) {readLine()!!}
 

   println(if (when (N==M) {
     true ->(0..(M-1)).all { Ai[it]==Bi[it]}
     else ->{
         var isMatched=false;
        for( i in 0..(N-1-M))
        {
          for( j in 0..(N-1-M))
          {
              isMatched=(0..(M-1)).all {
                Ai[j+it].substring(i..(i+M-1))==Bi[it]
            }
            if (isMatched)
            {
                break 
            }
          }
          if(isMatched) break
        }
        isMatched
     }
   }) "Yes" else "No")
  }
}