There are friends, indexed from to , who gathered to play a game of Rummy.
After playing many rounds, each friend obtained some score. The score of friend is an integer (in Rummy, scores can be negative). Friends and obtained a non-negative score. This made the other friends jealous, so they devised the following maneuver in order to make every score non-negative:
- Friend () gives one point to each of their two neighbours.
In other words, after friend applies the maneuver, their score decreases by two (), and the scores of friends and increase by one (, ). Note that friends and are not allowed to apply the maneuver.
Each friend can apply the maneuver as many times as they want, even if their score is negative, or becomes negative after the maneuver.
Task
Determine whether every friend can have a non-negative score (all at the same time) after applying some number of maneuvers.
Input data
The first line of the input contains a single integer , the number of test cases. test cases follow, each preceded by an empty line.
Each test case consists of:
- a line containing the integer ;
- a line containing the integers .
Output data
For each test case, print YES
if there is a sequence of or more maneuvers such that in the end each friend will have a non-negative score, otherwise print NO
.
Constraints and clarifications
- for each
- The sum of across all test cases does not exceed .
# | Points | Constraints |
---|---|---|
1 | 0 | Examples |
2 | 6 | |
3 | 22 | |
4 | 38 | , |
5 | 34 | No additional constraints |
Example
stdin
5
2
12 -10 20 0
3
7 -8 19 -10 5
10
4 40 0 0 0 0 0 0 0 0 -6 0
10
4 40 0 0 0 0 0 0 0 0 -4 0
4
6 -10 7 8 -12 25
stdout
YES
YES
NO
YES
NO
Explanation
In the first test case of the sample case, friend can apply the maneuver times. In the end, the scores will be as follows: .
In the second test case of the sample case, friend can apply the maneuver times. The scores will become: .
Then, friend will apply the maneuver once, resulting in the following scores: .