If (x-b) is the HCF of f(x) = x^2 + ax + 1 and g(x) = x^2 - 3x + 2, find the value of a and b.