This exchange shows a negative question and its reply. はい indicates that what the other person has said is correct. Therefore, to confirm the other person's assumption expressed in the negative form, use はい before the negative statement. This rule applies to V, Aい, Aな, and N sentences. Note that the reply would begin with "No" in English in situations like these.
A: アリさんは いませんか。
Isn't Ali there?
B: はい、アリさんは いません。
No, Ali isn't here.
A: なつ休みは みじかく ないですか。
Isn't summer vacation short?
B: はい、みじかく ないです。
No, it isn't short.
A: あしたは 休みでは ありませんか。
Isn't tomorrow a holiday?
B: はい、あしたは 休みでは ありません。
No, it's not a holiday.