  We combine an analytically solvable mean-field elasto-plastic model with
molecular dynamics simulations of a generic glass-former to demonstrate that,
depending on their preparation protocol, amorphous materials can yield in two
qualitatively distinct ways. We show that well-annealed systems yield in a
discontinuous brittle way, as metallic and molecular glasses do. Yielding
corresponds in this case to a first-order nonequilibrium phase transition. As
the degree of annealing decreases, the first-order character becomes weaker and
the transition terminates in a second-order critical point in the universality
class of an Ising model in a random field. For even more poorly annealed
systems, yielding becomes a smooth crossover, representative of the ductile
rheological behavior generically observed in foams, emulsions, and colloidal
glasses. Our results show that the variety of yielding behavior found in
amorphous materials does not result from the diversity of particle interactions
or microscopic dynamics {\it per se}, but is instead unified by carefully
considering the role of the initial stability of the system.
