Scanf.scanf "%d %d" (fun n m ->
    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 o = n - m in
    let rec loop_oy oy =
        let rec loop_ox ox =
            let rec loop_y y =
                let rec loop_x x =
                    if x = m then true else
                        if a.(oy + y).[ox + x] <> b.(y).[x] then false
                            else loop_x (x + 1)
                in
                if y = m then true else
                    if loop_x 0 then loop_y (y + 1) else false
            in
            if ox > o then false else
                if loop_y 0 then true else loop_ox (ox + 1)
        in
        if oy > o then false else
            if loop_ox 0 then true else loop_oy (oy + 1)
    in
    print_endline @@ if loop_oy 0 then "Yes" else "No"
)