import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val m = sc.nextInt()
    val a = (1..n).map { sc.next() }
    val b = (1..m).map { sc.next() }

    for (i in 0..(n - m)) {
        for (j in 0..(n - m)) {
            var isEq = true
            for (k in 0 until m) {
                if (a[i + k].substring(j, j + m) != b[k]) {
                    isEq = false
                    break
                }
            }
            if (isEq) {
                println("Yes")
                return
            }
        }
    }
    println("No")
}