the minister of husbandry (司僕卿, Sipu Qing), although he remained chancellor. Soon, Wu Zetian, while letting Yao remain chancellor, made him the commanding general of the army at Lingwu, apparently again contemplating a campaign against Eastern Tujue. Before Yao departed for Lingwu, Wu Zetian met him personally and asked him to recommend someone who is suitable for being chancellor, and Yao recommended Zhang Jianzhi. She then made Zhang Jianzhi chancellor. In spring 705, while Yao was still away from Luoyang, Wu Zetian was ill, and the affairs of state were largely decided by Zhang Yizhi and his brother Zhang Changzong, also Wu Zetian's lover, and there were rumors that Zhang Yizhi and Zhang Changzong were planning on formally seizing power. Zhang Jianzhi, distressed over the situation, entered into a plot with other officials Cui Xuanwei, Jing Hui, Huan Yanfan, and Yuan Shuji, as well as the generals Li Duozuo and Li Dan (李湛, note different character than the Prince of Xiang), to carry out a coup. Once Yao returned from Lingwu, Zhang Jianzhi and Huan discussed the plot with him, and he joined the plot. Soon, the coup was carried out, and Zhang Yizhi and Zhang Changzong were killed. Wu Zetian, while still carrying the title of emperor, was forced to yield the throne to her son Li Xian the Crown Prince (formerly emperor), and Li Xian was restored to the throne as Emperor Zhongzong. For his participation in the coup, Yao was created the Marquess of Liang. During Emperor Zhongzong's second reign Soon, Wu Zetian was moved from the main palace to the secondary palace Shangyang Palace (上陽宮), under heavy guard, although Emperor Zhongzong still honored her with the title of Emperor Zetiandasheng (則天大聖皇帝, from which "Wu Zetian," by which she was later known, was derived). When she was moved, most officials celebrated, but Yao Yuanzhi wept bitterly. Huan Yanfan and Zhang Jianzhi told him, "This is no time for you to cry. It may be that today is the start of a disaster for you." Yao responded: Huan and Zhang Jianzhi thereafter demoted Yao to be the prefect of Bo Prefecture (亳州, roughly modern Bozhou, Anhui). Perhaps because of this, he survived the subsequent reprisal that Emperor Zhongzong later carried out at the suggestion of his cousin Wu Sansi (Wu Zetian's nephew) against the coup leaders in 706, and he later was made the prefect of Chang Prefecture