import java.util.*
import kotlin.math.acos
import kotlin.math.cos
import kotlin.math.round
import kotlin.math.sin

fun main(args: Array<String>) {
    val (n, m) = readIntList()
    val a = List(n) { readString() }
    val b = List(m) { readString() }

    for (i in 0 until n) {
        if (i + m > n) continue
        for (j in 0 until n) {
            if (j + m > n) continue

            var match = true
            for (k in 0 until m) {
                for (l in 0 until m) {
                    if (a[i + k][j + l] != b[k][l]) match = false
                }
            }
            if (match) {
                println("Yes")
                return
            }
        }
    }

    println("No")
}

// read
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)