Horizontal gauge symmetry and masses of neutrinos