The equation
$$(x-1)(x-2)\cdots(x-2016)=(x-1)(x-2)\cdots(x-2016)$$
is written on the board. One tries to erase some linear factors from both sides so that each side still has at least one factor, and the resulting equation has no real roots. Find the least number of linear factors one needs to erase to achieve this.

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