A necessary and sufficient condition for the existence of real coupling coefficients for a finite group