#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%ll", &x)
#define pi(x) printf("%d", x)
#define pl(x) printf("%ll", x)
#define fo(i, n,m) for (int i = n; i < m; i++)
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define endl "\n"
#define deb(x) cout << #x << "=" << x << "\n"
#define all(x) x.begin(), x.end()
#define clr(x, p) memset(x, p, sizeof(x))
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<int, int> vii;
typedef vector<long long, long long> vll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
const ll MAX = 2e3 + 5;
const ll mod = 1e9 + 7;
void solve() {
	ll n;
	cin >> n;
	ll arr[n];
	vl pre(n, 0);
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	ll curr = 0;
	for (int i = 0; i < n; i++) {
		curr ^= arr[i];
		pre[i] = curr;
	}
	bool yes = !pre[n - 1];
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n - 1; j++)
			yes |= (pre[i] == (pre[j] ^ pre[i]) && pre[i] == (pre[n - 1] ^ pre[j]));
	}
	cout << (yes ? "YES" : "NO") << endl;
}

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	srand(chrono::high_resolution_clock::now().time_since_epoch().count());
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("error.txt", "w", stderr);
	freopen("output.txt", "w", stdout);
#endif
	int t = 1;
	cin >> t;
	// int i = 1;
	while (t--) {
		// cout << "Case #" << i << ": ";
		solve();
		// i++;
	}

	return 0;
}