A problem related with sum of uniform variables This problem appeared in my mid-term exam. 
Let $U_n$, $n\ge1$, be i.i.d. random variables which are uniform in $(0, 1)$. 
Given a constant $t>0$, let $N$ denote the value of $n$ such that 
$$U_{1} U_{2}\cdots U_{n} \ge e^{-t} \gt U_{1}U_{2}\cdots U_{n}U_{n+1}\qquad\qquad (1)$$
Note that we define $N=0$ when $U_1\lt e^{-t}$. What is the probability mass function of $N$?
I thought that the first step is to compose $(1)$ by $\ln$. Then, $(1)$ is transformed into:
$$\ln U_{1}+\ln U_{2}+\cdots+\ln U_{n} \ge -t > \ln U_{1}+\ln U_{2}+\cdots+\ln U_{n}+\ln U_{n+1}$$
Let $X_{i}=\ln U_{i}$ for every $i$.
Since $X_{i} \in (-\infty,0)$, $f_{N}(n)>0$ for every $n\ge0$.
But I have no idea how to do the next step.
Thanks.   
 A: This is the classical procedure to generate a Poisson random variable, hence, for every $n\geqslant0$,
$$
P[N=n]=\mathrm e^{-t}\frac{t^n}{n!}.
$$
One can indicate at least two proofs. First, the elementary way: as noted in the comments, 
$$
[N=n]=[X_1+\cdots+X_{n+1}\gt t\geqslant X_1+\cdots+X_n],
$$ 
where $(X_n)_n$ is i.i.d. standard exponential. Hence $P[N=n]=A_{n+1}-A_n$ where $A_0=0$ and, for every $n\geqslant1$,
$$
A_n=P[X_1+\cdots+X_{n}\gt t].
$$
Now, the distribution of $X_1+\cdots+X_n$ is gamma with parameters $(n,1)$ hence
$$
A_{n+1}=\int_t^{+\infty}\mathrm e^{-x}\frac{x^{n}}{n!}\mathrm dx.
$$
Integrating by parts yields
$$
A_{n+1}=\left[-\mathrm e^{-x}\frac{x^{n}}{n!}\right]_t^{+\infty}-\int_t^{+\infty}(-\mathrm e^{-x})\frac{x^{n-1}}{(n-1)!}\mathrm dx=\mathrm e^{-t}\frac{t^{n}}{n!}+A_{n},
$$
hence we are done.
Second, a less elementary way: the points $\{X_1+\cdots+X_n\mid n\geqslant1\}$ are a Poisson process of constant intensity $1$ hence the number of points in the interval $[0,t]$ is Poisson with parameter $t$. This number of points is exactly $N$.
