add n_mod_m in java src