Ibn Mas’ood (radiyallaahu-anhu) said:

”Do not be [إمعة–yes men], saying: If the people are good (or righteous), we are good (or righteous); and if they do wrong (or become unrighteous), we do wrong (or become unrighteous); but make up your mind; If the people do good (or are righteous), then be good (or righteous). If they do evil, then do not do wrong.”

———————————————————————————————————————–

[A statement of Ibn Mas’ood. See Shaikh Albaani.. Al-Mishkaat Number: 5129]