character(100),allocatable,dimension(:)::A,B
integer N,M,check
read*,N,M
allocate(A(N))
allocate(B(M))
read*,A
read*,B
do i=1,N-M+1
 do j=1,N-M+1
 	if(A(i)(j:j+M-1)==trim(B(1)))then
     check=0
     do k=1,M
      if(A(i+k-1)(j:j+M-1)/=trim(B(k)))check=1
     end do
     if(check==0)then
      print"(A)","Yes"
      stop
     endif
    endif
 end do
end do
print"(A)","No"
end