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

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

int t;
cin>>t;
while(t--)
{

	int n,x;
	cin>>n;
	ll a[n+1];
	a[0]=0;
	for(int i=1;i<=n;i++)
	{
		cin>>x;
		a[i]=x^a[i-1];
	}	
	
    bool yes=!a[n];

    for(int i=1;i<=n;i++)
    {
    	for(int j=i+1;j<n;j++)
    	{
    		yes|=(a[i]==(a[i]^a[j]) && a[i]==(a[n]^a[j]));
    	}
    } 

	cout<<(yes?"YES\n":"NO\n");
    
	
}

return 0;

}
