The hypergeometric solutions of the KZ equations were constructed almost 30 years ago. The polynomial solutions of the KZ equations over the finite field $F_p$ with a prime number $p$ of elements were constructed recently. In this paper we consider the example of the KZ equations whose hypergeometric solutions are given by hyperelliptic integrals of genus $g$. It is known that in this case the total $2g$-dimensional space of holomorphic solutions is given by the hyperelliptic integrals. We show that the recent construction of the polynomial solutions over the field $F_p$ in this case gives only a $g$-dimensional space of solutions, that is, a half of what the complex analytic construction gives. We also show that all the constructed polynomial solutions over the field $F_p$ can be obtained by reduction modulo $p$ of a single distinguished hypergeometric solution. The corresponding formulas involve the entries of the Cartier-Manin matrix of the hyperelliptic curve. That situation is analogous to the example of the elliptic integral considered in the classical Y.I. Manin's paper in 1961.