fun main(args: Array<String>) {
    val (N, M) = readLine()!!.split(" ").map {it.toInt()}
    val A = Array(N) { readLine()!! }
    val B = Array(M) { readLine()!! }

    fun match(di: Int, dj: Int): Boolean {
        for (i in B.indices) for (j in B[i].indices) {
            if (A[di + i][dj + j]  != B[i][j]) {
                return false
            }
        }
        return true
    }

    var res = false

    for (i in 0 .. N - M) for (j in 0 .. N - M) {
        res = res || match(i, j)
    }

    println(if (res) "Yes" else "No")
}
