9. The function $f(x)$ is defined by the following table:
\begin{tabular}{|c|c|c|c|c|c|}
\hline$x$ & 2 & 5 & 3 & 1 & 4 \\
\hline$f(x)$ & 1 & 2 & 3 & 4 & 5 \\
\hline
\end{tabular}

If $a_{0}=5, a_{n+1}=f\left(a_{n}\right), n=0,1,2, \cdots$, then $a_{2007}=$ $\qquad$ .