#include<iostream>
#include <math.h>
#include<vector>
#include<cmath>
#include<cstring>
#include<climits>
#include<string>
#include<list>
#include<utility>
#include<queue>
#include<map>
#include<unordered_map>
#include<stack>
#include<set>
#include<algorithm>
#include<unordered_set>
using namespace std; 
#define ll        long long int 
#define lld        long double
#define pb         push_back
#define ppb        pop_back
#define ios        ios_base::sync_with_stdio(false),cin.tie(NULL);
#define all(v) v.begin(),v.end()
#define set(arr,x) memset(arr,x,sizeof(arr))
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>b;i--)
#define repm(i,a,b) for(ll i=a;i>b;i--)
#define sz(x)      (ll)x.size()
#define sl(x)      (ll)x.length()
#define fin0       for(ll i=n-1;i>-1;i--)
#define all(v)     v.begin(),v.end()
    
#define max3(a,b,c)   max(max((a),(b)),(c))
#define max4(a,b,c,d) max(max((a),(b)),max((c),(d)))
#define min3(a,b,c)   min(min((a),(b)),(c))
#define min4(a,b,c,d) min(min((a),(b)),min((c),(d)))
#define pii           pair<int,int>
#define pll           pair<ll,ll>
#define mp            make_pair
#define ft            first
#define sd            second
#define vi            vector<int>
#define vll           vector<ll>  
#define cntbit(x) __builtin_popcount(x)

 
const ll inf=100000000000000001;
const ll mod=1000000007;
 
ll pow(ll x, unsigned ll y, ll p){
    ll res=1;
    x=x%p;
    if (x==0) return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
ll _pow(ll a, ll b){
    if(!b)
        return 1;
    ll temp = _pow(a, b / 2);
    temp = (temp * temp);
    if(b % 2)
        return (a * temp);
    return temp;
}
ll invmod(ll a,ll m){
	return pow(a,m-2,m);
}
 
 ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b); 
     
}
ll lcm(ll a,ll b)
{
    return (a/gcd(a,b))*b;
}
bool isprime(ll n) 
{   if (n<=1)  return false; 
    if (n<=3)  return true; 
    if (n%2==0||n%3==0) return false; 
   for (ll i=5;i*i<=n; i=i+6) 
        if (n%i==0||n%(i+2)==0) 
           return false; 
  
    return true;
} 
 
 bool coprime(ll a, ll b) {      
 if (gcd(a,b)==1) 
 return true;  
 else return false;
                 
}
void sub(ll &a, ll b){
    b%=mod;
    a=(a+mod-b);
    a%=mod;
}

vll fact;
void factorial()
{
    fact.resize(1e6+1);
      fact[0] = 1;
    for (ll i = 1; i <=1e6; i++)
        fact[i] = (fact[i - 1] * i) % mod;
 
}
 ll ncrmod( ll n,ll r, ll p)
{   if (n < r)   return 0;
     if (r == 0)  return 1;
 return (fact[n]*invmod(fact[r],p)%p*invmod(fact[n-r],p)%p)%p;
}
// //const ll N=2e5;
// ll pri[N];
// void sieve(ll n)
// {
//   rep(i,0,n+1)pri[i]=1;
//   pri[2]=1,pri[1]=pri[0]=0;
//   for(ll i=4;i<=n;i+=2)pri[i]=0;
//   for(ll i=3;i*i<=n;i++)
//   {
//       if(pri[i])
//       {
//           for(ll j=i*i;j<=n;j+=i)
//           {
//               pri[j]=0;
//           }
//       }
//   }
// }
/*******************************CODE START'S HERE************************/
const ll N = 1e6+1;//this is taken because the limit given over there is 3*10^5 therefore we have to take this things 
ll n,e,mid=0;
ll a,c;
void solution()
{
    cin>>n;
    vll r(n,0);
    rep(i,0,n)cin>>r[i];
    ll x=0,x1=0,f=0;
    rep(i,0,n-1)
    {
        x=x^r[i];
        f=0;
        x1=0;
        //cout<<x<<"ll"<<endl;
        rep(j,i+1,n)
        {
            x1=x1^r[j];
           // cout<<x1<<endl;
            if(x1==x)
            {
                x1=0;
                f=1;
            }
        }
        if(x1==0 && f)
        {
            cout<<"YES"<<endl;
            return;
        }
        //cout<<"hello"<<endl;
    }
    cout<<"NO"<<endl;
}
int main() {
    //now let's start coding the problem again and seeing where are we amking mistake
    ios
    ll t=1;
    cin>>t;
    while(t--)
    {
     solution();
    }
    
    return 0;
}  