Never grow a wishbone, daughter, where your backbone ought to be.
-Clementine Paddleford
Absolutely!
In the same way that someone in the midst of a rough crowd guards a wound with great care, so in the midst of bad company should one always guard the wound that is the mind.
-Santideva, “Bodhicaryavatara”
Most of the time, I prefer avoiding bad company—but the advice is certainly good for those times when I can’t avoid it.