Sufficient number of integrals for the pth-order Lyness equation