let n, m = Scanf.scanf " %d %d" @@ fun a b -> a, b
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s
let bs = Array.init m @@ fun _ -> Scanf.scanf " %s" @@ fun s -> s
let _ = for i = 0 to n - m do
  for j = 0 to n - m do
    let is_ok = ref true in
    for y = 0 to m - 1 do
      for x = 0 to m - 1 do if a_s.(i + y).[j + x] <> bs.(y).[x] then is_ok := false done done;
    if !is_ok then (print_endline "Yes"; exit 0) done done; print_endline "No"