//mode by lsy
#include<bits/stdc++.h>
#define ll long long
#define rep(i,x,y) for(int i=x;i<=y;i++)
#define dd(x) cout<<"# "<<x<<" #\n"
using namespace std;
const int inf = 0x3f3f3f3f, maxn = 2e5 + 5;
ll a[maxn];
int main() {
	std::ios::sync_with_stdio(0),cin.tie(0);
	int t;cin>>t;
	while(t--){
		int n;cin>>n;
		int s=0;
		rep(i,1,n) cin>>a[i],s^=a[i];
		if(!s) cout<<"YES\n";
		else{
			int tt=0,cn=0;
			rep(i,1,n){
				tt^=a[i];
				if(tt==s){
					cn++;
					tt=0;
				}
			}
			if(cn>=2&&!tt) cout<<"YES\n";
			else cout<<"NO\n";
		}
	}
	return 0;
}
/*
	Simplicity is a prerequisite for stability.
			——by acmer lsy
*/