sentence1: The Keita dynasty ruled pre-imperial and imperial Mali from the 12th century into the early 17th century .
sentence2: The Keita dynasty ruled Mali from the 12th to the early 17th century , pre-imperial and imperial .