import java.io.PrintWriter
val pw = PrintWriter(System.out)

fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    val (n, m) = listOfInt()
    var aa = mutableListOf<String>()
    var bb = mutableListOf<String>()

    repeat(n) { aa.add(next()) }
    repeat(m) { bb.add(next()) }

    // vertical
    for(i in 0..n-m) {
        // horizontal
        for(j in 0..n-m) {
            var cursor = 0
            val index = aa[i].indexOf(bb[cursor], j)
            if (index == -1) continue

            // check vertically
            var failed = false
            while (cursor < bb.size) {
                if (aa[i + cursor].indexOf(bb[cursor], j) != index) {
                    failed = true
                    break
                }
                cursor++
            }

            if (!failed) {
                println("Yes")
                return
            }
        }
    }

    println("No")
}

fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { it.toInt() }

fun println(value : Any) {
    pw.println(value)
}