Influence of Nambu-Goldstone mode on energy-weighted sum of excitation strengths in random-phase approximation