open Batteries
let () =
  let n,m = Scanf.scanf "%d %d " (fun a b -> a,b) in
  let a = Array.init n (fun _ -> Scanf.scanf "%s " (fun a -> a)) in
  let b = Array.init m (fun _ -> Scanf.scanf "%s " (fun a -> a)) in
  let a = Array.map (fun arr -> String.to_list arr |> Array.of_list) a in
  let b = Array.map (fun arr -> String.to_list arr |> Array.of_list) b in

  let res = ref "No" in
  for i=0 to n-1-(m-1) do
    for j=0 to n-1-(m-1) do
      let arr = Array.filteri (fun ai x -> ai >= i && ai <= i+m-1) a in
      let arr = Array.map (fun ar -> Array.filteri (fun aj x -> aj >= j && aj <= j+m-1) ar) arr in
      if arr = b then res := "Yes"
    done;
  done;

  Printf.printf "%s\n" !res
