A curve passes through the point 1,-11 and its gradient at any point is ax2+b, where a and b are constants. The tangent to the curve at point 2,-16 is parallel to the x axis. Find the values of a and b.