import scala.io.StdIn

object Main extends App {

  val Array(n, m) = StdIn.readLine().split(" ").map(_.toInt)

  val a = (0 until n).map{ _ =>
    StdIn.readLine()  
  }
  
  val b = (0 until m).map{ _ =>
    StdIn.readLine()
  }
  
  var im = 0
  var jm = 0
  var judge = false
  
  for(i <- 0 until n if im < m){
    val ai = a(i)
    val bi = b(im)
    
    jm = if(jm != 0) jm else jm
    var judgeLine = false
    while(jm + m < n && !judgeLine){
      judgeLine = true
      for(j <- 0 until m if judgeLine){
        judgeLine = (bi(j) == ai(jm + j))
      }
      jm += (if(judgeLine) 0 else 1)
    }
    judge = judgeLine
    im += 1
  }

  println(if(judge) "Yes" else "No")
}