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()
  }

  // b loop
  var i = 0
  var j = 0
  var beforesi = -1

  while(i + b.size <= a.size && j < b.size){
    val ai = a(i)
    val bj = b(j)
    val si = ai.indexOf(bj)
    //println(s"$i: $si" )
    if(si >= 0 && (si == beforesi || beforesi == -1)){
      i += 1
      j += 1
      beforesi = si
    } else {
      i += 1
      j = 0
      beforesi = -1
    }
  }
  
  println(if(beforesi != -1 && j == b.size) "Yes" else "No")
  
  
}
