Existence of optimal solutions to mathematical programs with equilibrium constraints