Question
If $Y_1,\dots, Y_n \sim \; \textrm{iid geometric(p)}$, show that $\bar{Y}$ is a sufficient statistic for p.
My work
Factorization Theorem
If $Y_1, \dots, Y_n \sim \; \textrm{iid}$ then U is a sufficient statistic if
$$ L(\theta) = g(U,\theta)h(Y_1,\dots,Y_n) $$
My actual work
The likelihood function for $Y_1, \dots, Y_n$ is
\begin{align} L(p) &= \prod_{i=1}^n{f_{Y_i}(y)} = \begin{bmatrix} p(1-p)^{y_i-1} \end{bmatrix}^n \notag \\ &= p^{n}(1-p)^{\sum_{i=1}^n{(y_i - 1)}} \notag \\ &= p^{n}(1-p)^{(n\bar{Y} - n)} = p^n(1-p)^{n(\bar{Y} - 1)} \notag \end{align}
Applying the above factorization theorem gives us
\begin{align} &g(\bar{Y},p) = p^n(1-p)^{n(\bar{Y} - 1)} \notag \\ &h(Y_1, \dots, Y_n) = 1 \notag \end{align}
Therefore, we conclude that $\bar{Y}$ is a sufficient statistic for p.