Viability analysis of the first-order mean field games