fun main(args: Array<String>) {
    val (n, m) = readLine()?.split(" ")?.map(String::toInt) ?: return
    val a = mutableListOf<String>()
    repeat(n) {
        a.add(readLine() ?: return)
    }
    val b = mutableListOf<String>()
    repeat(m) {
        b.add(readLine() ?: return)
    }
    0.until(n - (m - 1)).forEach { i ->
        0.until(n - (m - 1)).forEach { j ->
            var match = true
            b.forEachIndexed loop@{ index, bs ->
                val s = a[i + index].substring(j, j + bs.length)
                if (s != bs) {
                    match = false
                    return@loop
                }
            }
            if (match) {
                println("Yes")
                return
            }
        }
    }
    println("No")
}