program sample
    implicit none
    character(100),allocatable::s(:),t(:)
    integer(8) :: i,j,k,m,n
    integer(8)::a,b,c,d
    integer(8),allocatable::x(:),y(:)
  
    read(*,*) n,m
    allocate(s(n),t(m))
    do i=1,n
        read(*,*)s(i)
    end do
    do i=1,m
        read(*,*)t(i)
    end do
    if(m==1)then
        do i=1,n
            do j=1,n
                if(s(i)(j:j) .eq. t(1))then
                    write(*,*)'Yes'
                    stop
                end if
            end do
        end do
        write(*,*)'No'
        stop
    end if
    
    do i=1,n+1-m
        do j=1,n+1-m
            if(s(i)(j:j+m-1) .eq. t(1))then
                do k=2,m
                    if(s(i-1+k)(j:j+m-1) .ne. t(k))then
                        exit
                    elseif(k==m)then
                        write(*,*)'Yes'
                        stop
                    endif
                end do
            end if
        end do
    end do
    write(*,*)'No'
    stop
end program sample
  

