let input = readLine()!.split(separator: " ").map{ Int($0)! }
let N = input[0]
let M = input[1]

enum Color: Character {
    case white = "."
    case black = "#"
}

var A = [[Color]]()
var B = [[Color]]()

for _ in stride(from: 0, to: N, by: 1) {
    A.append(Array(readLine()!).map { Color(rawValue: $0)! })
}
for _ in stride(from: 0, to: M, by: 1) {
    B.append(Array(readLine()!).map { Color(rawValue: $0)! })
}

func solveB() -> Bool {
    for ix in stride(from: 0, through: N - M, by: 1) {
        for iy in stride(from: 0, through: N - M, by: 1) {
            var containsB = true
            B: for jx in stride(from: 0, to: M, by: 1) {
                for jy in stride(from: 0, to: M, by: 1) {
                    if A[ix + jx][iy + jy] != B[jx][jy] {
                        containsB = false
                        break B
                    }
                }
            }
            if containsB {
                return true
            }
        }
    }
    return false
}

print(solveB() ? "Yes" : "No")
