human
Baby Ehab is known for his love for a certain operation. He has an array a of length n, and he decided to keep doing the following operation on it: 

  * he picks 2 adjacent elements.
he then removes them and places a single integer in their place: their [bitwise XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR). Note that the length of the array decreases by one. 


Now he asks you if he can make all elements of the array equal. Since babies like to make your life harder, he requires that you leave at least 2 elements remaining.

Input

The first line contains an integer t (1 ≤ t ≤ 15) — the number of test cases you need to solve.

The first line of each test case contains an integers n (2 ≤ n ≤ 2000) — the number of elements in the array a.

The second line contains n space-separated integers a_1, a_2, …, a_{n} (0 ≤ a_i < 2^{30}) — the elements of the array a.

Output

If Baby Ehab can make all elements equal while leaving at least 2 elements standing, print "YES". Otherwise, print "NO".

Example

Input

2
3
0 2 2
4
2 3 1 10

Output

YES
NO

Note

In the first sample, he can remove the first 2 elements, 0 and 2, and replace them by 0 ⊕ 2=2. The array will be [2,2], so all the elements are equal.

In the second sample, there's no way to make all the elements equal.
The above is tricky. Write me a correct solution in PYTHON3.
assistant
#Here is Python code to print "YES".

import sys

def inp(): return sys.stdin.readline().rstrip("\r\n")

def N():
    return int(inp())

def lis(): return list(map(int, inp().split()))

def stringlis(): return list(map(str, inp().split()))

def sep(): return map(int, inp().split())

def strsep(): return map(str, inp().split())

def fsep(): return map(float, inp().split())

def testcase(t):
    for p in range(t):
        solve()

#### END ITERATE RECURSION ####
###########################
# Sorted list
class SortedList:
    def __init__(self, iterable=[], _load=200):
        """Initialize sorted list instance."""
        values = sorted(iterable)
        self._len = _len = len(values)
        self._load = _load
        self._lists = _lists = [values[start:start + _load] for start in range(0, _len, _load)]
        self._list_lens = [len(_list) for _list in _lists]
        self._mins = [_list[0] for _list in _lists]
        self._fen_tree = []
        self._rebuild = True

    def _fen_build(self):
        """Build a fenwick tree instance."""
        self._fen_tree[:] = self._list_lens
        _fen_tree = self._fen_tree
        for start in range(len(_fen_tree)):
            if start | start + 1 < len(_fen_tree):
                _fen_tree[start | start + 1] += _fen_tree[start]
        self._rebuild = False

    def _fen_update(self, index, value):
        """Update `fen_tree[index] += value`."""
        if not self._rebuild:
            _fen_tree = self._fen_tree
            while index < len(_fen_tree):
                _fen_tree[index] += value
                index |= index + 1

    def _fen_query(self, end):
        """Return `sum(_fen_tree[:end])`."""
        if self._rebuild:
            self._fen_build()

        _fen_tree = self._fen_tree
        A = 0
        while end:
            A += _fen_tree[end - 1]
            end &= end - 1
        return A

    def _fen_findkth(self, k):
        """Return a pair of (the largest `idx` such that `sum(_fen_tree[:idx]) <= k`, `k - sum(_fen_tree[:idx])`)."""
        _list_lens = self._list_lens
...