The development of agriculture allowed higher populations, with the newly dense and settled societies becoming hierarchical, with inequalities in wealth and freedom. As the cooling and drying of the climate by 3800 BCE caused drought in Mesopotamia, village farmers began co-operating and started creating larger settlements with irrigation systems. This new water infrastructure in turn required centralised administration with complex social organisation. The first cities and systems of greater social organisation emerged in Mesopotamia, followed within a few centuries by ones at the Indus and Yellow River Valleys. In the cities, the workforce could specialise as the whole population did not have to work for food production, while stored food allowed for large armies to create empires. The first empires were those of Ancient Egypt and Mesopotamia. Smaller kingdoms existed in North China Plain, Indo-Gangetic Plain, Central Asia, Anatolia, Eastern Mediterranean, and Central America, while the rest of humanity continued to live in small tribes.