fun main(args: Array<String>) {
    val (n,m) = readLine()!!.split(" ").map { it.toInt() }
    val a = (1..n).map { readLine()!! }
    val b = (1..m).map { readLine()!! }

    for(y in 0..n-m)for(x in 0..n-m) {
        if((0..m-1).all{ i-> (0..m-1).all{ j-> a[y+i][x+j]==b[i][j] } }) {
            println("Yes")
            return
        }
    }
    println("No")
}