X-ray photoelectron spectroscopy study of Y2BaCuO5 and YBa2Cu3O9−δ