Does "quality" mean the same thing in these two sentences?

A man of quality.

A peasant is not allowed to fall in love with a lady of quality.
the same meaning