QOJ.ac

QOJ

时间限制: 2 s 内存限制: 512 MB 总分: 100

#16482. Odd Occurrence

统计

Erine has a sequence $a$ of length $n$. Clearly, this sequence has $2^n-1$ non-empty subsequences (if two subsequences have the same content but different positions, we consider them as two distinct subsequences).

Erine writes all $2^n-1$ subsequences on a piece of paper. After writing them down, she wants to organize and categorize these subsequences. Specifically, Erine puts subsequences with the same content into the same box, while subsequences with different contents are placed in different boxes.

However, there are too many subsequences! Erine only wants to know whether, after organizing the subsequences, every non-empty box contains exactly an odd number of subsequences.

Input

This problem contains multiple test cases.

The first line contains an integer $t$ ($1 \leq t \leq 10^5$), representing the number of test cases. For each test case:

  • The first line contains an integer $n$ ($1 \le n \le 2\times 10^6$).
  • The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le n$).

It is guaranteed that the sum of $n$ over all test cases does not exceed $2\times 10^6$.

Output

For each test case, output a single line containing the string Yes or No, indicating whether every non-empty box contains exactly an odd number of subsequences after organizing them.

Examples

Input 1

3
3
1 2 1
5
1 1 1 2 3
7
2 2 2 2 2 2 2

Output 1

No
Yes
Yes

Note

For the first test case, the box containing the subsequence $\{1\}$ has $2$ subsequences.

For the second test case, every non-empty box contains exactly an odd number of subsequences.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.