#C5105. Guaranteed Draw Game

    ID: 48718 Type: Default 1000ms 256MiB

Guaranteed Draw Game

Guaranteed Draw Game

You are given several test cases. In each test case, you have a bag of fruits. The bag contains n fruits, and each fruit is represented by an integer indicating its type. Two players (you and Alex) take turns picking fruits optimally. You want to know if you can guarantee at least a draw.

It can be proven that you can guarantee a draw if and only if the number of distinct fruit types is at least $$\lceil \frac{n}{2} \rceil$$. For each test case, output YES if this condition holds, otherwise output NO.

inputFormat

The input is given from stdin and has the following format:

  1. The first line contains an integer T, the number of test cases.
  2. For each test case:
    1. The first line contains an integer n, the number of fruits.
    2. The second line contains n space-separated integers indicating the types of the fruits.

outputFormat

For each test case, output a single line to stdout containing either YES or NO according to whether you can guarantee at least a draw.

## sample
3
6
1 2 3 4 5 6
5
1 1 1 1 1
4
1 2 2 1
YES

NO YES

</p>