
import java.util.Scanner

/**
 * Created by sonetsuyoshi on 2015/12/16.
 */

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val m = sc.nextInt

  val a = Array.fill(n)(sc.next).map(_.toCharArray)
  val b = Array.fill(m)(sc.next).map(_.toCharArray)

  run()

  def run(): Unit = {
    val l = n - m + 1
    val exists = 0.until(l * l).exists(k => {
      val i = k / l
      val j = k % l
      isMatch(i, j)
    })

    val ans = if(exists) "Yes"
    else "No"

    println(ans)

  }

  def isMatch(i: Int, j: Int): Boolean = {
    0.until(m * m).forall(k => {
      val i1 = k / m
      val j1 = k % m
      a(i + i1)(j + j1) == b (i1)(j1)
    })
  }
}
