program ABC054B
    implicit none
    character(50)::s
    integer(8)::N,M,i,j,k,l,conv
    integer(8)::mask_sum=0
    integer(8)::flg=0
    integer(8),dimension(50,50)::img,mask
    read(5,*)N,M

    do i=1,N
        read(5,*)s
        do j=1,N
            if(s(j:j)==".")then
                img(j,i)=1
            else
                img(j,i)=0
            end if
        end do
    end do

    do i=1,M
        read(5,*)s
        do j=1,M
            if(s(j:j)==".")then
                mask(j,i)=1
                mask_sum=mask_sum+1
            else
                mask(j,i)=0
            end if
        end do
    end do


    do i=1,N-M
        do j=1,N-M
            conv=0
            do k=1,M
                do l=1,M
                    if(mask(l,k)==img(l+j,k+i))conv=conv+1
                end do
            end do
            if(conv==M*M)then
                flg=1
                exit
            end if
        end do
        if(flg==1)exit
    end do

    if(flg==1)then
        print'(A)',"Yes"
    else
        print'(A)',"No"
    end if
end program ABC054B