let () = Scanf.scanf "%d %d\n" (fun n m ->
  let as_ = Array.init n (fun i -> Scanf.scanf "%s\n" (fun a -> (i, a))) in
  let bs = Array.init m (fun i -> Scanf.scanf "%s\n" (fun b -> (i, b))) in
  let bs' = Array.to_list bs in
  Array.to_list as_
  |> List.exists (fun (i, a) ->
    Array.init n (fun j -> j)
    |> Array.to_list
    |> List.filter (fun j ->
        try String.sub a j m = snd (bs.(0)) with
        | _ -> false)
    |> List.exists (fun j ->
        List.for_all (fun (k, b) ->
          try String.sub (snd (as_.(i + k))) j m = b with
          | _ -> false) bs'))
  |> (function true -> print_endline "Yes" | false -> print_endline "No"))