fun main(arr: Array<String>) {
    println(if(getAns()) "Yes" else "No")
}

fun getAns():Boolean {
    val (n,m) = readLine()!!.split(" ").map { it.toInt() }
    val pict = (1..n).map { readLine()!! }
    val template = (1..m).map { readLine()!! }

    for(i in (0 .. (n-m))) {
        for(j in (0 .. (n-m))) {
            var isMatch = true
            for(r in template.indices) {
                for(c in template.indices) {
                    if(template[r][c] != pict[r+i][c+j]) {
                        isMatch = false
                        break
                    }
                }
                if(!isMatch) {
                    break
                }
            }
            if(isMatch) {
                return true
            }
        }
    }
    return false
}