Vyxal, 14 1212 10 bytes
?lƛṫ$∑=;AlṠṪ?nȯ⁼)ṅ‹ṅ Man this new "lambda to newline" thing is cool.
-2 thanks to @emanresuA
Explained
?lƛṫ$∑=;AlṠṪ?nȯ⁼)ṅ‹ṅ )ṅ # Get the first positive integer n where: ?lƛ Ṡ ;A # all overlapping# windows of sizethe sums of n:all ?l ṫ$∑ # overlapping windows haveof the suminput of everylength itemn but the last Ṫ = # #with the tail removed equal to the last⁼ item # exactly equals ‹ ?nȯ # decrement n input[n:]