PolynomialMod[ x^1001 - 1 , x^4 + x^3 + 2x^2 + x + 1 ]