Halliday & Matthiessen (2014: 175):
yes and no may function as statements; either in answer to a question, in acknowledgement to a statement, in undertaking of a command or in acceptance of an offer. They are then mood Adjuncts. In this function they are phonologically salient and often carry tonic prominence. They may occur elliptically, as a clause on their own; or thematically within the responding clause. So, in answer to It’s Tuesday, isn’t it? we might have various forms of denial, as in Figure 4-19. Note that in (b) the response consists of two clauses; the no is tonic, as shown by the comma in writing, and could have stood alone as an answer. In (c) the no is salient but not tonic, and the response is a single clause.