Codeforces Round 891 (Div. 3) |
---|

Finished |

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

greedy

math

*800

No tag edit access

The problem statement has recently been changed. View the changes.

×
A. Array Coloring

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputYou are given an array consisting of $$$n$$$ 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 [$$$1,2,4,3,2,3,5,4$$$], we can color it as follows: [$$$\color{blue}{1},\color{blue}{2},\color{red}{4},\color{blue}{3},\color{red}{2},\color{red}{3},\color{red}{5},\color{red}{4}$$$], where the sum of the blue elements is $$$6$$$ and the sum of the red elements is $$$18$$$.

Input

The first line contains an integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases.

Each test case begins with a line containing an integer $$$n$$$ ($$$2 \le n \le 50$$$) — the length of the array $$$a$$$.

The next line contains $$$n$$$ integers $$$a_1,a_2, \dots, a_n$$$ ($$$1 \le a_i \le 50$$$) — the elements of the array $$$a$$$.

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).

Example

Input

781 2 4 3 2 3 5 424 733 9 821 755 4 3 2 144 3 4 5250 48

Output

YES NO YES YES NO YES YES

Note

The first sample is described in the statement.

In the second sample, there are only two colorings $$$[\color{blue}{4},\color{red}{7}]$$$ and $$$[\color{red}{4},\color{blue}{7}]$$$ , but in both cases the parity of sums is different.

In the third sample, you can color $$$[\color{blue}{3},\color{blue}{9},\color{red}{8}]$$$ and $$$12$$$ and $$$8$$$ are both even.

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Feb/28/2024 18:42:12 (l3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|