After his father was ruined by a late 19th-century depression that ravaged the Chinese economy, Yan enrolled in a free military school that was run and financed by the Manchu government in Taiyuan.
Setelah bank ayahnya bangkrut akibat depresi ekonomi Tiongkok pada akhir abad ke-19, Yan mendaftar ke sekolah militer yang dijalankan dan dibiayai oleh pemerintah Manchu di Taiyuan.