#include<bits/stdc++.h>
using namespace std;
#define Go_ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define llu long long unsigned int
#define pii pair<int ,int>
#define PII pair<ll ,ll>

const int Max=1e9+100;
const ll  MAX=2e18+500;
const int sz=2e5+100;

int main()
{
    Go_
    ll a,b,c,i,j,k,q,p,x,y,ct,ct1,m,l,r,x1,y1,mn,h,sum1,in,z,mid,n,mx;
    char ch;
    double d;
    string str1,str2,str;
    bool bl,bl1;
    int t,cs=1;

    cin>>t;
    while(t--)
    {
        cin>>n;
        bool bl=false;
        ll ara[n];
        ll suf[n];
        for(int i=0;i<n;i++) cin>>ara[i];
        suf[n-1]=ara[n-1];
        for(int i=n-2;i>=0;i--) suf[i] =(ara[i] ^ suf[i+1]);
        
        
        ll pref=0;
        for(int i=0;i<n-1 && !bl;i++){   
           pref ^= ara[i];
           ll now=0;

           int j=i+1;
           while(j<n){
               now ^= ara[j];
               if(now==pref){
                   if(j==n-1) bl=true;
                   else if((now ^ suf[j+1])==pref) bl=true;
                   now=0ll;
               }
               ++j;
           }
        }

        if(bl) cout<<"YES\n";
        else cout<<"NO\n";
    }
    

   
}
