In the given sentence, the word "Yes" is not functioning as a specific grammatical element. Instead, it is used as an interjection to express agreement or affirmation. Interjections are words or phrases that are used to convey strong emotions or sudden reactions. They often stand alone and are separated from the rest of the sentence by a comma or an exclamation mark. In this case, "Yes" is simply indicating agreement before the speaker continues with the rest of the sentence.