 #include <bits/stdc++.h>
using namespace std;
#define fr(i,a,n) for(int i=a;i<n;i++)
#define ll long long
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vpp vector<pair< int, int > >
#define pll pair<int , int >
#define ppll pair < pll , pll >
#define mod 1000000007
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        int arr[n];
        fr(i,0,n)
        {
            cin>>arr[i];
        }
        set<int>s;
        int sum=arr[0];
        fr(i,1,n)
        {
            sum^=arr[i];
            //cout<<sum<<endl;
        }
        if(sum==0)
        cout<<"YES"<<endl;
        else 
        {
           int cnt=0,temp=0;
           fr(i,0,n)
           {
               temp^=arr[i];
               if(temp==sum)
               {
                   cnt++;
                   temp=0;
               }
           }
           if(cnt>1)
           {
               cout<<"YES"<<endl;
           }
           else cout<<"NO"<<endl;
        }
    }
}
