Yawning is known to be contagious in primates, but having a good bath is something birds often will do in company. As soon as one starts, others nearby, often of the same species, will copy. Bathing washes and cleans feathers, and afterwards, the bird dries up by shaking tail, wings, body and head and then proceeds to oils the feathers by spreading over them a secretion produced by a gland above its tail. A few days ago, I watched these Mallards bathing and preening in sequence with some enthusiasm, today it was some Great Black Backed Gulls, the Sparrows in my garden often do it as well.
Male Mallards have good reason to keep their feathers in top condition, as they will be already paired or looking for a partner at this time of year. Maybe bathing is also an opportunity for showing off.