A sequence $a_1,a_2,\dots$ of non-negative integers is defined by the rule $a_{n+2}=|a_{n+1}-a_n|$ for $n\geq 1$. If $a_1=999$, $a_2<999$ and $a_{2006}=1$, how many different values of $a_2$ are possible?
$\textbf{(A)}\ 165 \qquad \textbf{(B)}\ 324 \qquad \textbf{(C)}\ 495 \qquad \textbf{(D)}\ 499 \qquad \textbf{(E)}\ 660$