# include<bits/stdc++.h>

using namespace std ;

# define f first

# define s second

# define ll long long

# define pb push_back

# define pob pop_back

# define INF INT_MAX

# define INFL 1e18 + 10

# define mod 1000000007

# define pii pair<int , int>

# define all(v) v.begin() , v.end()

# define debug(x) cerr << #x << " = " << x << "\n" ;

# define rep( i , s , e ) for( ll i = s ; i <= e ; i++ )

# define repR( i , e , s ) for( int i = e ; i >= s ; i-- )



void solve() {

    int n ;  cin >> n ;  ll X[n] , a ;  cin >> X[0] ;

    rep( i , 1 , n - 1 ) cin >> a , X[i] = X[i - 1] ^ a ;

    rep( i , 0 , n - 2 )

        if ( X[i] == ( X[n - 1] ^ X[i] ) ) { cout << "YES\n" ;  return ; }

    rep( i , 0 , n - 3 ) 

        rep( j , i + 1 , n - 2 ) 

            if ( X[i] == ( X[j] ^ X[i] ) && X[i] == ( X[n - 1] ^ X[j] ) ) { cout << "YES\n" ;  return ; }

    cout << "NO\n" ;
}


int main() {

    ios_base::sync_with_stdio( false ) ;

    cin.tie(0) , cout.tie(0) ;

    int testCase ;  cin >> testCase ;

    while( testCase-- ) solve() ;

    return 0 ;
}
