We study numerically the yielding transition of a two dimensional model glass subjected to athermal quasi-static cyclic shear deformation, with the aim of investigating the effect on the yielding behaviour of the degree of annealing, which in turn depends on the preparation protocol. We find two distinct regimes of annealing separated by a threshold energy. Poorly annealed glasses progressively evolve towards the threshold energy as the strain amplitude is increased towards the yielding value. Well annealed glasses with initial energies below the threshold energy exhibit stable behaviour, with negligible change in energy with increasing strain amplitude, till they yield. Discontinuities in energy and stress at yielding increase with the degree of annealing, consistently with recent results found in three dimensions. We observe significant structural change with strain amplitude that closely mirrors the changes in energy and stresses. We investigate groups of particles that are involved in plastic rearrangements. We analyse the distributions of avalanche sizes, of clusters of connected rearranging particles, and related quantities, employing finite size scaling analysis. We verify previously investigated relations between exponents characterising these distributions, and a newly proposed relation between exponents describing avalanche and cluster size distributions.