We use a production function approach to investigate the factors that determine young adults' human capital outcomes in Madagascar and Senegal. Our study relies on unique and comparable panel data spanning over 15 years for both countries. We find that second-grade students' test scores are strong indicators of their French and math skills, as well as their educational attainment in their early twenties. Moreover, we observe that the association between second-grade skills and later-life outcomes is stronger among girls than boys, and in math test scores compared with French test scores. Our results emphasise the critical role of performing well during the early school years, as it predicts long-term outcomes, especially for vulnerable populations such as girls.