Write a program to tell if a given sequence of integer numbers is balanced or not. Let . In this problem, we say that a sequence is balanced if , or if the left-hand half and the right-hand half have the same sum, and both are balanced.
For instance, the sequence 5 -3 2 0 -1 3 2 is balanced, because the sum of 5 -3 2 0 and the sum of -1 3 2 are 4, and it is easy to see that both sequences are balanced.
Input consists of several cases. Every one begins with , followed ny integer numbers. You can assume .
For every case, print “yes” or “no” as
required.
Author: Unknown
Translator: Salvador Roura
Generation: 2026-01-25T11:28:31.478Z
© Jutge.org, 2006–2026.
https://jutge.org