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

    for (i in 0..N - M) {
        for (j in 0..N - M) {
            var ok = true
            for (k in 0 until M) {
                if (A[i + k].substring(j, j + M) != B[k]) {
                    ok = false
                    break
                }
            }
            if (ok) {
                println("Yes")
                return
            }
        }
    }
    println("No")
}
