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 k = 0 to m - 1 do
        for l = 0 to m - 1 do if a_s.(i + k).[j + l] <> bs.(k).[l] then is_ok := false done done;
      if !is_ok then (print_endline "Yes"; exit 0) done done;
 print_endline "No"