"يجزي عن الجماعة إذا مروا أن يسلم أحدهم، ويجزي عن الجلوس أن يرد أحدهم "
The Prophet (peace and blessings be upon him) said:
"When a group passes by, it suffices for all of them if one of them gives the greeting of salam, and it suffices for all of those seated if one of them returns it."
Hadith Referenceصحیح الجامع الصغیر / حرف الياء / 8023