Given a table in a form of the regular $1000$-gon with sidelength $1$. A Beetle initially is in one of its vertices. All $1000$ vertices are numbered in some order by numbers $1$, $2$, $\ldots$, $1000$ so that initially the Beetle is in the vertex $1$. The Beetle can move only along the edges of $1000$-gon and only clockwise. He starts to move from vertex $1$ and he is moving without stops until he reaches vertex $2$ where he has a stop. Then he continues his journey clockwise from vertex $2$ until he reaches the vertex $3$ where he has a stop, and so on. The Beetle finishes his journey at vertex $1000$. Find the number of ways to enumerate all vertices so that the total length of the Beetle's journey is equal to $2017$.