(1) As Dozy said, it could mean anything, maybe even depending on how you say the word “yes.”
(2) Tourist in New York City: Could you tell me how to get to the Statue of Liberty?
New York resident: Ah, yes! (I thought you were going to ask me that question. You look like a tourist./ I am often asked that question, so I have learned the best and clearest way to give directions./ Of course, I can! Do you think that I’m stupid?)
However, there is a slight difference I think because in this case the person actually asks a question that can be answered “yes”. In the original case there was no direct question, only an implied one.