import scala.util.control.Breaks._

object Main extends App {
  val Array(n, m) = scala.io.StdIn.readLine().split(' ').map(_.toInt)
  val as = Array.fill(n)(scala.io.StdIn.readLine().split(""))
  val bs = Array.fill(m)(scala.io.StdIn.readLine).mkString

  breakable {
    for (hi <- 0 to n - m) {
      for (w <- 0 to n - m) {
        val tmp = (for (h <- 0 until m) yield {
          as(h + hi).slice(w, w + m).mkString
        }).mkString

        if (tmp == bs) {
          println("Yes")
        }
      }
    }

    println("No")
  }
}
