H2O is the electron donor and it's required for the reduction of NAD(P)H+. O2 is the product.