SSE-SAM: Balancing Head and Tail Classes Gradually through Stage-Wise SAM