We study the determinants of educational and cognitive outcomes of young adults in Madagascar and Senegal employing a production function approach. Using unique and comparable long-term panel data sets from both countries, we find that cognitive skills measured using test scores in second grade are strong predictors of school attainment and cognitive skills of a cohort of individuals surveyed in their early twenties. The inclusion of early life household wealth, parental education and other household characteristics in the model does not diminish the impact of early cognitive ability on educational and cognitive outcomes in young adult life. Additionally, we find that both early life cognitive ability and health seem to have independent effects on educational attainment and adult cognition. In Senegal, both math and French scores are strong predictors of adult cognitive skills, whereas in Madagascar math plays a relatively stronger role. We find suggestive evidence that the association between early life cognitive ability and later life outcomes is stronger among girls as compared to boys. We also show significant differences in the relationship between early ability and later life test scores for those cohort members according to their height, which we consider a proxy for health status - shorter individuals show a stronger relationship between second grade performance and later life outcomes. These findings highlight the importance of how falling behind in early life may be critical in determining longterm outcomes, particularly for vulnerable groups, that is girls and shorter individuals.