fun main(args: Array<String>){
    val (N, M) = readLine()!!.split(" ").map(String::toInt)
    val A = Array(N){readLine()!!}
    val B = Array(M){readLine()!!}
    for(i in 0..N-M){
        for(j in 0..N-M){
            if((0..M-1).all{A[i+it].substring(j,j+M) == B[it]}){
                println("Yes")
                return
            }
        }
    }
    println("No")
}
