[step:Invoke Lagrange interpolation to count consistent polynomials]Let $S \in \mathbb{F}_p$ be fixed. Consider the $k$ points
\begin{align*}
(0, S), \; (i_1, y_1), \; \dots, \; (i_{k-1}, y_{k-1}) \in \mathbb{F}_p \times \mathbb{F}_p.
\end{align*}
The $x$-coordinates $0, i_1, \dots, i_{k-1}$ are $k$ distinct elements of $\mathbb{F}_p$: they are pairwise distinct by hypothesis, and $0 \notin \{i_1, \dots, i_{k-1}\}$ because the $i_j$ lie in $\{1, \dots, n\}$. Since $p > n$, none of $0, 1, \dots, n$ collapse under reduction modulo $p$, so the $k$ points are genuinely distinct in $\mathbb{F}_p$.
We apply [Lagrange interpolation over a field](/theorems/???), which states: given $k$ distinct points $x_0, \dots, x_{k-1} \in \mathbb{F}_p$ and arbitrary values $v_0, \dots, v_{k-1} \in \mathbb{F}_p$, there exists a unique polynomial $g \in \mathbb{F}_p[t]$ of degree at most $k - 1$ with $g(x_j) = v_j$ for $j = 0, \dots, k - 1$. With $(x_0, v_0) = (0, S)$ and $(x_j, v_j) = (i_j, y_j)$ for $j \ge 1$, this gives a unique polynomial $f_S \in \mathbb{F}_p[t]$ of degree at most $k - 1$ satisfying
\begin{align*}
f_S(0) = S \quad \text{and} \quad f_S(i_j) = y_j \text{ for } j = 1, \dots, k - 1.
\end{align*}[/step]