There is a reason why S>N Consider the possible case described in the following diagram, in which the window size coincides with the space of serial numbers, i.e. S=N

Here, in the above image, the spaces of serial numbers are indicated: 2^m , where m is the size of the header serial number field in bits.
Now consider the first case where Sf is 0 and Sn is 1. The timer starts as soon as the first frame is sent. When the first frame is received, the receiver sends an ACK. but suppose he is lost for some reason.
But since the window size is 4, the sender will continue to send the next frames until it reaches the maximum window size. ( 4 in this case).
Since there is no loss in frames, frames will successfully reach the receiver, Rn will increase by 1 each time a frame arrives.
Assume all ACK. lost. and after a while the timer goes off. Thus, the sender will assume that frames are lost or ACKs are lost. Thus, he will be outraged by the data from the beginning. But at the end of the receiver frames arrive successfully, it will wait for the next frame (in this case, 0 ).
And the sender will also send frame 0 . What is the previous frame. But the receiver will be mistaken.
So it is better to have the window size (N) should be less than the sequence number space (S).
Consider the following diagram:

In the above diagram, the size is S=N+1 or window 2^m-1 . In this case, we also assume the same as we expected in the previous case. But the difference is that, finally, the receiver will wait for frame 3 , and the sender will send frame 0 . Therefore, it will be discarded. And therefore, the sender will send the whole set of frames again.
Therefore, in the second case, there are more opportunities for successful communication.
Hope this helps you.