#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N = 1e5 + 5;
int n, t, a[N];
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> t;
    while(t--) {
        cin >> n;
        for(int i = 0;i < n;i++)
            cin >> a[i];
        int xr = 0;
        bool yes = false;
        for(int i = 0;i < n;i++) {
            xr ^= a[i];
            int xr1 = 0, cnt = 1;
            for(int j = i + 1;j < n;j++) {
                xr1 ^= a[j];
                if(xr1 == xr)
                    cnt++, xr1 = 0;
            }
            if(xr1 == 0 && cnt >= 2)
                yes = true;
        }
        yes ? cout << "YES\n" : cout << "NO\n";
    }
    return 0;
}