#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define endl "\n"

int main(){
    int t;cin>>t;
    while(t--){
        ll n;cin>>n;
        ll arr[n];
        ll xr=0;
        for(int i=0; i<n; ++i){
            cin>>arr[i];
            xr ^= arr[i];
        }
        bool ans=false;
        if(xr==0){
            ans=true;
        }else{
            ll x=0, j=0;
            for(int i=0; i<n; ++i){
                x ^= arr[i];
                if(x==xr){
                    j++;
                    x=0;
                }
            }
            if(j>1){
                ans=true;
            }
        }
        if(ans){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}