Was ancient egypt a legacy civilization?