program main
  implicit none
  integer :: n, m, i, dx, dy
  character(50) :: a(50), b(50), res
  read (*, *) n, m
  a(:) = ""
  b(:) = ""
  do i = 1, n
    read (*, *) a(i)
  end do
  do i = 1, m
    read (*, *) b(i)
  end do
  res = "No"
  do dy = 0, n - m
    inner: do dx = 0, n - m
      do i = 1, m
        if (a(i + dy)(1 + dx:m + dx) /= b(i)(1:m)) exit inner
      end do
      res = "Yes"
    end do inner
  end do
  write (*, "(a)") trim(res)
end program main
