Detailed Instructions: Given a question and a context passage, generate the answer having the word or phrase from the context passage. Here, the answer should be a shortest continous span from the passage.
Q: Context: The 1688 Glorious Revolution replaced James II and VII with his Protestant daughter Mary II and her husband William III and II. Since neither Mary or her sister Anne had surviving children, the 1701 Act of Settlement ensured a Protestant successor by excluding Catholics from the English and Irish thrones, and that of Great Britain after the 1707 Act of Union. When Anne became the last Stuart monarch in 1702, her heir was the distantly related but Protestant Sophia of Hanover, not her Catholic half-brother James Francis Edward. Sophia died two months before Anne in August 1714; her son became George I and the pro-Hanoverian Whigs controlled government for the next 30 years. 
 Question: What happened first, 1701 Act of Settlement or 1707 Act of Union?
A:
1701 act of settlement