      program piyo
      integer,parameter :: p=8
      integer(p) :: n,m, i,j, offsetR,offsetC
      character(:),allocatable :: a,b
      integer(p),allocatable :: imA(:,:),imB(:,:),tempA(:,:)
      
      read*,n,m
      allocate( character(n)::a )
      allocate( character(m)::b )
      allocate( imA(N,N), imB(M,M), tempA(M,M) )
      do i = 1,n
        read*,a
        do j = 1,n
          if(a(j:j)=='.')then
            imA(i,j) = 1
          else
            imA(i,j) = 0
          end if
        end do
      end do
      do i = 1,m
        read*,b
        do j = 1,m
          if(b(j:j)=='.')then
            imB(i,j) = 1
          else
            imB(i,j) = 0
          end if
        end do
      end do
      
      do offsetR = 0,(N-M)
        do offsetC = 0,(N-M)
          tempA = imA(1+offsetR:M+offsetR,1+offsetC:M+offsetC)
          tempA = abs(tempA(:,:) - imB(:,:))
          if( sum(tempA(:,:))==0 )then
            print*,'Yes'
            stop
          end if
        end do
      end do
      
      print*,'No'
      
      stop
      
      do i = 1,n
        print'(*(i1,x))',ima(i,:)
      end do
      do i = 1,m
        print'(*(i1,x))',imb(i,:)
      end do
      
      
      
      end