The correct option is B modesty
The word 'vanity' refers to taking excessive pride in or admiration of one's own achievements or appearance.
Option A, humanity refers to the quality of being benevolent.
Option B, honesty refers to the quality of being morally correct.
Option C, courtesy refers to the showing of politeness in one's attitude and behaviour towards others.
Option D, modesty refers to the quality of being unassuming in the estimation of one's abilities.
Thus, according to the meaning, the word 'modesty' is the opposite of the word 'vanity'.