题目描述
Alice and Bob went to a pet store. There are N animals in the store where the i^{th} animal is of type A_{i}.
Alice decides to buy some of these N animals. Bob decides that he will buy all the animals left in the store after Alice has made the purchase.
Find out whether it is possible that Alice and Bob end up with exactly same [multiset] of animals.
------ Input Format ------
- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of multiple lines of input.
- The first line of each test case contains an integer N — the number of animals in the store.
- The next line contains N space separated integers, denoting the type of each animal.
------ Output Format ------
For each test case, output on a new line, YES, if it is possible that Alice and Bob end up with exactly same multiset of animals and NO otherwise.
You may print each character in uppercase or lowercase. For example, the strings YES, yes, Yes, and yES are considered identical.
------ Constraints ------
$1 ≤ T ≤ 1000$
$1 ≤ N ≤ 10^{5}$
$1 ≤ A_{i} ≤ 100$
- The sum of $N$ over all test cases won't exceed $2\cdot 10^{5}$.
----- Sample Input 1 ------
4
3
4 4 4
4
2 3 3 2
4
1 2 2 3
6
5 5 1 5 1 5
----- Sample Output 1 ------
NO
YES
NO
YES
----- explanation 1 ------
Test case $1$: There are $4$ possible cases:
- Alice does not buy anything: Bob will buy all the animals and will have $3$ animals of type $4$.
- Alice buys $1$ animal of type $4$: Bob will buy the remaining two animals of type $4$.
- Alice buys $2$ animals of type $4$: Bob will buy the remaining one animal of type $4$.
- Alice buys all $3$ animals of type $4$: Bob will not buy anything.
In no case, both Alice and Bob can have the exactly same multiset of pets.
Test case $2$: If Alice buys animals $1$ and $2$, having types $2$ and $3$ respectively, Bob will buy animals $3$ and $4$, having types $3$ and $2$ respectively. Thus, both Alice and Bob have $1$ animal of type $2$ and $1$ animal of type $3$.
Test case $3$: It can be proven that Alice and Bob cannot have the same multiset of pets in any case.
Test case $4$: If Alice buys animals $1, 2, $ and $5$, having types $5, 5,$ and $1$ respectively, Bob will buy animals $3, 4,$ and $6$, having types $1, 5,$ and $5$ respectively. Thus, both Alice and Bob have $1$ animal of type $1$ and $2$ animals of type $5$.
输入格式
见题面
输出格式
见题面