fun main(args:Array<String>) {
    val(n,m) = readLine()!!.split(" ").map { it.toInt() }
    val img = (1..n).map { readLine()!! }
    val template = (1..m).map { readLine()!! }
    for(i in (0 .. (n-m))) {
        val subImg = img.subList(i, i + m)
        for(j in (0..(n-m))) {
            if(template.indices.all { k->subImg[k].substring(j).startsWith(template[k]) })            {
                println("Yes")
                return
            }
        }
    }
    println("No")
}
