Let $P(x)$ be the product of all linear polynomials $ax+b$, where $a,b \in \{0,\ldots,2016\}$ and $(a,b) \neq (0,0)$. Let $R(x)$ be the remainder when $P(x)$ is divided by $x^5-1$. Determine the remainder when $R(5)$ is divided by $2017$.

Let's think step by step and output the final answer within \boxed{}.
user