Using a higher-order function for 'product' to compute the 'factorial' of a given number.