program abc054b
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,m,i,j
    character(1),allocatable:: a(:,:), b(:,:)

    read*, n,m
    allocate(a(n,n),b(m,m))
    input_char : block
        character(n):: inpt_a
        character(m):: inpt_b
        do i=1,n
            read*, inpt_a
            do j=1,n
                a(j,i) = inpt_a(j:j)
            end do
        end do
        do i=1,m
            read*, inpt_b
            do j=1,m
                b(j,i) = inpt_b(j:j)
            end do
        end do
    end block input_char

    do i=1,n-m+1
        do j=1,n-m+1
            if (fit(i,j))then
                print'(a)', 'Yes'
                stop
            end if
        end do
    end do

    print'(a)', 'No'

contains
    function fit(fx,fy) result(ret)
        integer(int32):: fx,fy
        integer(int32):: x,y
        logical:: ret   
        ret = .true.
        do x=1,m
            do y=1,m
                if (b(x,y) /= a(x+fx-1,y+fy-1)) then
                    ret = .false.
                    return
                end if
            end do
        end do
    end function
end program abc054b