Role and value of flexibility in facilitating cost-effective energy system decarbonisation