Both starvation and outflows drive galaxy quenching