Please choose the correct answer to the question: Beans and coal both have stored energy. Where did the energy come from that is stored in beans and coal?

Answer1: From the Earth's gravity Answer2: From the Sun's light Answer3: From the heat in the Earth's core Answer4: From the air's carbon dioxide

Answer format: answer1/answer2/answer3/answer4
Answer: answer2