#P1857A. Array Coloring
Array Coloring
Description
You are given an array consisting of integers. Your task is to determine whether it is possible to color all its elements in two colors in such a way that the sums of the elements of both colors have the same parity and each color has at least one element colored.
For example, if the array is [], we can color it as follows: [], where the sum of the blue elements is and the sum of the red elements is .
The first line contains an integer () — the number of test cases.
Each test case begins with a line containing an integer () — the length of the array .
The next line contains integers () — the elements of the array .
For each test case, output "YES" (without quotes) if it is possible to color the array in two colors in such a way that the sums of the elements of both colors have the same parity and each color has at least one element colored, and "NO" otherwise.
You can output "Yes" and "No" in any case (for example, the strings "yES", "yes", and "Yes" will be recognized as correct answers).
Input
The first line contains an integer () — the number of test cases.
Each test case begins with a line containing an integer () — the length of the array .
The next line contains integers () — the elements of the array .
Output
For each test case, output "YES" (without quotes) if it is possible to color the array in two colors in such a way that the sums of the elements of both colors have the same parity and each color has at least one element colored, and "NO" otherwise.
You can output "Yes" and "No" in any case (for example, the strings "yES", "yes", and "Yes" will be recognized as correct answers).
Note
The first sample is described in the statement.
In the second sample, there are only two colorings and , but in both cases the parity of sums is different.
In the third sample, you can color and and are both even.