Question: What year did the First Opium War end?
Sentence: Nanjing was invaded by British troops during the close of the First Opium War, which was ended by the Treaty of Nanjing in 1842.
Answer in sentence: yes