
import java.io.BufferedReader

fun main(args: Array<String>) {
    /** comment in when you submit **/
        System.`in`.bufferedReader().use { println(getOutputString(it)) }

    /** delete below after your test **/
//    executeTest()
}

private fun getOutputString(reader: BufferedReader): String {
    val lines = reader.readLines()
    val (l, lm) = lines[0].split(" ").map(String::toInt).let {
        Pair(it[0], it[1])
    }
    val a = lines.subList(1, 1 + l)
    val b = lines.subList(l + 1, l + 1 + lm)

    (0..(l - lm)).map { Pair(it, a[it].indexOf(b[0])) }
            .filter{ it.second >= 0 }
            .forEach { i ->
                (i.second..(l - lm)).filter { a[i.first].substring(it, it + lm) == b[0] }
                        .forEach { j ->
                            if (lm == 1) {
                                return "Yes"
                            }
                            for (k in (1..lm)) {
                                if (a[i.first + k].substring(j, j + lm) != b[k]) {
                                    break
                                }
                                if (k == lm - 1) {
                                    return "Yes"
                                }
                            }
                        }
            }

    return "No"
}

/** delete below after your test **/
private fun String.mustBe(expected: String): Unit {
    if (this != expected) throw Exception("\"$this\" must be \"$expected\"")

    println("ok")
}

private fun executeTest() {
    getOutputString("3 2\n#.#\n.#.\n#.#\n#.\n.#\n".toByteArray(Charsets.UTF_8).inputStream().bufferedReader()).mustBe("Yes")
    getOutputString("4 1\n....\n....\n....\n....\n#".toByteArray(Charsets.UTF_8).inputStream().bufferedReader()).mustBe("No")
}
