Ordering of oxygen into chains and distribution of hole density in YBa2Cu3O1+x