E. Jor Shongkot
time limit per test
4 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

You have an array $$$a$$$ of length $$$n$$$ (n is odd). You can do the following operation with this array:

  • choose any positive integer $$$x,$$$ and change $$$a_i$$$ to $$$a_i$$$ $$$\oplus$$$ $$$x$$$, for all $$$ 1 \leq i \leq n$$$.

You have to tell if it is possible to transform the array into a permutation by applying the operation any number of times.

A sequence of $$$n$$$ numbers is called a $$$permutation$$$ if it contains all integers from $$$1$$$ to $$$n$$$ exactly once. For example, the sequences $$$[1,2], [4,2,1,3]$$$ are permutations, but $$$[0], [1,3], [2,1,2,4]$$$ – are not.

Input

The first line contains a single integer $$$n(1 \leq n \lt 10^6)$$$, (n is odd).

The second line contains $$$n$$$ space separated integers $$$a_1, a_2, ..., a_n$$$$$$(0 \leq a_i \leq 2\cdot10^6)$$$.

Output

Output "YES"(without quotes) if the array can be transformed into a permutation, and "NO"(without quotes) otherwise.

You can output "YES" or "NO" in any case.(For example, strings "yES", "yes" and "Yes" will be recognized as a positive response).

Examples
Input
1
3
Output
YES
Input
3
1 2 3
Output
YES
Input
5
1 2 3 4 800
Output
NO
Input
5
0 1 2 7 6
Output
YES