import scala.io.{ StdIn => in}
import scala.annotation.tailrec

object Main extends App {
  val Array(n, m) = in.readLine.split(" ").map(_.toInt)
  val a = Iterator.continually(in.readLine.toCharArray)
    .take(n)
    .toArray
  val b = Iterator.continually(in.readLine.toCharArray)
    .take(m)
    .toArray

  val res = for {
    i <- 0 until n-m
    j <- 0 until n-m
    } yield {
      val res0 = for {
        k <- 0 until m
        l <- 0 until m
      } yield {
        a(i+k)(j+l) == b(k)(l)
      }
      res0.forall(_ == true)
    }

  val ans = if(res.exists(_ == true)) "Yes" else "No"
  println(ans)
}