#include<bits/stdc++.h>
#define ll long long
const int maxn=2002;
ll a[maxn];
using namespace std;
int main()
{
    int t;
    int n;
    cin>>t;
    while(t--)
    {
        cin>>n;
        for(int i=1; i<=n; i++)
            cin>>a[i];
                ll ans1=0;
        for(int i=1;i<=n;i++)//n为偶数时
        {
            ans1^=a[i];
        }
        if(ans1==0)
        {
            cout<<"YES"<<endl;
            continue;
        }
        else
        {
             ll cnt=0;ll ans=0;
        for(int i=1;i<=n;i++)
        {
            ans^=a[i];
            if(ans1==ans) cnt++,ans=0;
        }
        if(ans==0&&cnt>=3) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
            
        }
       



    }

}
