Say that a function f:{1,2,...,1001}→Z is almost polynomial if there is a polynomial p(x)=a200x200+...+a1x+a0 such that each an is an integer with ∣an∣≤201, and such that ∣f(x)−p(x)∣≤1 for all x∈{1,2,...,1001}. Let N be the number of almost polynomial functions. Compute the remainder upon dividing N by 199.