An analytic solution describing an ion-acoustic collisionless shock, self-consistently with the evolution of shock-reflected ions, is obtained. The solution extends the classic soliton solution beyond a critical Mach number, where the soliton ceases to exist because of the upstream ion reflection. The reflection transforms the soliton into a shock with a trailing wave and a foot populated by the reflected ions. The solution relates parameters of the entire shock structure, such as the maximum and minimum of the potential in the trailing wave, the height of the foot, as well as the shock Mach number, to the number of reflected ions. This relation is resolvable for any given distribution of the upstream ions. In this paper, we have resolved it for a simple "box" distribution. Two separate models of electron interaction with the shock are considered. The first model corresponds to the standard Boltzmannian electron distribution in which case the critical shock Mach number only insignificantly increases from M1.6 (no ion reflection) to M1.8 (substantial reflection). The second model corresponds to adiabatically trapped electrons. They produce a stronger increase, from M3.1 to M4.5. The shock foot that is supported by the reflected ions also accelerates them somewhat further. A self-similar foot expansion into the upstream medium is described analytically.