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 counts = reader.readLine().split(" ").map { it.toInt() }

    val a = mutableListOf<String>()
    val b = mutableListOf<String>()

    for (i in 0 until counts[0]) {
        a.add(reader.readLine())
    }
    for (i in 0 until counts[1]) {
        b.add(reader.readLine())
    }

    // 候補を探す
    for (xOffset in 0 until b[0].length) {
        val startCandidates = mutableListOf<Pair<Int, Int>>()
        for (i in 0..a.size - b.size) {
            startCandidates.add(a[i].indexOf(b[0], xOffset) to i)
        }

        startCandidates.forEach {
            var ok = true
            for (i in 0 until b.size) {
                ok = ok && a[i + it.second].startsWith(b[i], it.first + xOffset)
            }

            if (ok) return "Yes"
        }
    }

    return "No"
}
