Nucleosynthesis during the Early History of the Solar System