local n, m = io.read("*n", "*n", "*l")
local a, b = {}, {}
for i = 1, n do
  local s = io.read()
  for j = 1, n do
    table.insert(a, s:sub(j, j))
  end
end
for i = 1, m do
  local s = io.read()
  for j = 1, m do
    table.insert(b, s:sub(j, j))
  end
end

local function check(x, y)
  for i = 1, m do
    for j = 1, m do
      local i_b = (i - 1) * m + j
      local i_a = (x + i - 2) * n + y + j - 1
      if b[i_b] ~= a[i_a] then return false end
    end
  end
  return true
end

local f = false
for i = 1, n + 1 - m do
  for j = 1, n + 1 - m do
    if check(i, j) then f = true break end
  end
  if f then break end
end
print(f and "Yes" or "No")
