Yes men are usually portrayed as spineless sycophants who place their desire for advancement above the common good but their behavior is more likely the result of the environmental contingencies in which they find themselves, specifically reactions from the leader they advise, than the result of their own personalities.
If the threat of punishment for telling the unwanted truth outweighs the possibility of reward for telling it and the possibility of reward for telling the wanted untruth outweighs the threat of punishment for telling it then the predictable response will be telling the wanted untruth.
Therefore the sort of spineless, obsequious behavior derided by anyone who views the situation from the outside actually has more to do with the leader, who can be considered the trainer from the behavioral point of view, than it has to do with the advisers, who can be considered the trainees. They have observed what happens after telling the unfettered truth enough times to have adjusted their responses accordingly.
If what a leader desires is honest opinions and these honest opinions are consistently positively reinforced while what a leader despises is bootlicking and bootlicking is consistently negatively reinforced then this very different set of environmental contingencies from the set outlined above will virtually guarantee the dearth of yes men in an advisory role.
If you want to discover a tyrant look no further than the supporting cast of characters. These characters are apt to resort to flattery, obsequiousness, and sycophancy not because they really feel this way but because their behaviors are positively reinforcing in forms like praise and advancement and help them to avoid negatively reinforcing stimuli like being yelled at, humiliated, ostracized, or even dismissed.