Find the largest possible degree n≤1000 of a polynomial p(x) such that:

p(i)=i for every integer i with 1≤i≤n
p(−1)=1671
p(0) is an integer (not necessarily 0).

835