James recognised nonetheless that peace between Scotland and England was in the interest of both countries and established good diplomatic relations with England, which was emerging at the time from a period of civil war. First he ratified the Treaty of Ayton in 1497. Then, in 1502, James signed the Treaty of Perpetual Peace with Henry VII. This treaty was sealed by his marriage to Henry's daughter Margaret Tudor the next year in an event portrayed as the marriage of The Thrissil and the Rois (the thistle and rose – the flowers of Scotland and England, respectively) by the great poet William Dunbar, who was then resident at James' court.