A necessary and sufficient condition of nonresonance for a semilinear Neumann problem