Number-resolved preparation of mesoscopic atomic ensembles. (13th December 2021)