Let's break this down. Initially, they have Kaman and Beaubois. Then, they have Bass, Melo, and a pick. Then, they trade Bass and the pick for cap space, so they end up with Melo and cap space. If they do nothing, they have Beaubois and cap space instead.
Meanwhile, the Celtics spend a pick for the privilege of trading two bigs who can play now for one big who can play now.