#include <bits/stdc++.h>

using namespace std;
#define PB push_back
#define MP make_pair
#define ll long long
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)−1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define ld long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

const int N = int(3e5) + 99;

int n, m, k;
int a[N];

void YES() {
    cout << "YES\n";
}

void NO() {
    cout << "NO\n";
}

ll quickPower(int a, int n) {
	if (n == 0)
		return 1;
	if (n%2)
		return a * quickPower(a, n-1);
	ll wyn = quickPower(a, n/2);
	return wyn*wyn;
}

ld sqr(ld a) {
	return a*a;
}

void solve() {
    cin >> n;
    long long x, y = 0;
    long long tab[n];

    for(int i = 0; i < n;i++)
    {
        cin >> tab[i];
        y ^= tab[i];
    }
    x = y;

    if (y == 0) {
        cout << "YES\n";
        return;
    }
    int cnt = 0;
    for(int i = 0; i < n;i++)
    {
        y ^= tab[i];

        if (y == 0) {
            cnt++;
            y = x;
        }
    }

    if (cnt >= 3) {
        cout << "YES\n";
        return;
    }


    cout << "NO\n";
}

int main() {
    int t;
    cin >> t;
    RE(i,t) solve();
}
