Increasing the number of Science, Technology, Engineering and Math (STEM) university graduates is considered a key element for long-term productivity and competitiveness in the global economy. Still, little is known about what actually drives and shapes students' choices. This paper focusses on secondary school students at the very top of the ability distribution and explores the effect of more exposure to science on enrolment and persistence in STEM degrees at the university and on the quality of the university attended. The paper overcomes the standard endogeneity problems by exploiting the different timing in the implementation of a reform that induced secondary schools in the UK to offer more science to high ability 14 year-old children. Taking more science in secondary school increases the probability of enrolling in a STEM degree by 1.5 percentage point and the probability of graduating in these degrees by 3 percentage points. The results mask substantial gender heterogeneity: while girls are as willing as boys to take advanced science in secondary school - when offered -, the effect on STEM degrees is entirely driven by boys. Girls are induced to choose more challenging subjects, but still the most female-dominated ones.