The effects of oxidation and reduction on the X-ray photoelectron spectra of YBa2Cu3O7-x