Commuting automorphisms and characterization of an affine space