let n, m = Scanf.scanf "%d %d\n" (fun n m -> n, m)
let a = Array.init n (fun i -> read_line ())
let b = Array.init m (fun i -> read_line ())

let c = n - m + 1

let rec ans i j k l =
  if i = c then "No"
  else if j = c then ans (i + 1) 0 0 0
  else if k = m then "Yes"
  else if l = m then ans i j (k + 1) 0
  else if a.(i + k).[j + l] <> b.(k).[l] then ans i (j + 1) 0 0
  else ans i j k (l + 1)

let () = print_endline (ans 0 0 0 0)