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$ .
9. Let $n=0$, then $a_{1}=f\left(a_{0}\right)=5$, let $n=1$, then $a_{2}=f\left(a_{1}\right)=f(5)=2$, let $n=2$, then $a_{3}=f\left(a_{2}\right)=f(2)=1$, let $n=3$, then $a_{4}=f\left(a_{3}\right)=f(1)=4$, let $n=4$, then $a_{5}=f\left(a_{4}\right)=f(4)=5$, let $n=5$, then $a_{6}=f\left(a_{5}\right)=f(5)=$ $2, \cdots$, so $a_{2007}=a_{501 \times 4+3}=a_{3}=4$.