Used to indicate agreement.
Used to introduce a refutation, sometimes sarcastically.
A positive yes, of course.