Silesia's borders and national affiliation have changed over time, both when it was a hereditary possession of noble houses and after the rise of modern nation-states, resulting in an abundance of castles, especially in the Jelenia Góra valley. The first known states to hold power in Silesia were probably those of Greater Moravia at the end of the 9th century and Bohemia early in the 10th century. In the 10th century, Silesia was incorporated into the early Polish state, and after its division in the 12th century it became a Piast duchy. In the 14th century, it became a constituent part of the Bohemian Crown Lands under the Holy Roman Empire, which passed to the Austrian Habsburg Monarchy in 1526. As a result of the Silesian Wars, the region was annexed by the German state of Prussia in 1742.