Greeting on Arrival and Departure
The Prophet (sal Allahu alaihi wa sallam) said, “When one of you arrives in a gathering, he should offer Salam to those who are already there, and he should also do so when he intends to depart. The first act of greeting is not more of a duty than the last.”
[Sunan Abu Dawud, Al-Albaani said: (it is) Hasan Sahih]
We benefit from the above Hadith that we should offer As-Salam to those sitting in a gathering, on our arrival as well as when we are departing. Both the greetings are essential. “The first act of greeting is not more of a duty than the last” means that we should utter it on both occasions.
And Allah knows best!