Problem: To thank Ian, Mary gifted an array of length to Ian. To make himself look smart, he wants to make the array in non-decreasing order by doing the following finitely many times: he chooses two adjacent elements and (), and increases both of them by or decreases both of them by . Note that, the elements of the array can become negative.
As a smart person, you notice that, there are some arrays such that Ian cannot make it become non-decreasing order! Therefore, you decide to write a program to determine if it is possible to make the array in non-decreasing order.
Input Format: The first line contains a single integer () — the number of test cases. The description of test cases follows.
The first line of each test case consists of a single integer () — the number of elements in the array.
The second line of each test case contains integers () — the elements of the array .
It is guaranteed that the sum of over all test cases does not exceed .
Output Format: For each test case, output "YES" if there exists a sequence of operations which make the array non-decreasing, else output "NO".
You may print each letter in any case (for example, "YES", "Yes", "yes", "yEs" will all be recognized as positive answer).
Note: For the first test case, we can increase and both by . The array is now .
Then we can decrease and both by . The array is now , which is sorted in non-decreasing order. So the answer is "YES".
For the second test case, no matter how Ian perform the operations, will always be larger than . So the answer is "NO" and Ian cannot pretend to be smart.
For the third test case, the array is already in non-decreasing order, so Ian does not need to do anything.