It is narrated from Hazrat Abu Huraira (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) said: When any one of you arrives at a gathering, he should greet with salam, and when he wishes to stand up to leave the gathering, he should also greet with salam. And the first occasion does not have more right than the second occasion.