object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt()
  val a = Array.fill(n)(sc.next().map(_ == '#'))
  val b = Array.fill(m)(sc.next().map(_ == '#'))

  var found = false
  for {
    i <- 0 to n-m
    j <- 0 to n-m
    if !found
  } {
    var ok = true
    for {
      di <- 0 until m
      dj <- 0 until m
      if a(i + di)(j + dj) != b(di)(dj)
    } {
      ok = false
    }

    if (ok) {
      found = true
    }
  }
  println(if (found) "Yes" else "No")
}
