The Shang and Xia dynasties were alike in that they did not have an emperor, strictly speaking. The Qin was the first, with emperor Qin Shi Huangdi (lit. "the first emperor") ruling monarchically; the Han followed after his death. The Qin and Han dynasties both established important precedents for modern China. They were different in that Ghana was an older polity, having collapsed before Mali would rise to power. Additionally, while each kingdom coexisted alongside the great Islamic powers of the time, Mali's rulers converted to Islam whereas Ghana's did not.