    #include <bits/stdc++.h>
    using namespace std;
    typedef long l;
    #define mp make_pair
    #define pb push_back
    #define int unsigned int long long
    #define double long double
    typedef vector<int> vll;
    #define f(i,s,n) for(int i=s;i<n;i++)
    #define fe(i,s,n) for(int i=s;i<=n;i++)
    #define fr(i,s,n) for(int i=s;i>n;i--)
    #define fre(i,s,n) for(int i=s;i>=n;i--)
    const int maxn = 2e6 + 10;
    // const int MOD = 998244353;
    const int MOD = 1000000007;
    const int INF = 1e9;

    int add(int x, int y)
    {
        x += y;
        while(x >= MOD) x -= MOD;
        while(x < 0) x += MOD;
        return x;
    }

    int mul(int x, int y)
    {
        return (x * 1ll * y) % MOD;
    }

    int binpow(int x, int y)
    {
        int ans = 1;
        while(y > 0)
        {
            if(y % 2 == 1)
                ans = mul(ans, x);
            x = mul(x, x);
            y /= 2;
        }
        return ans;
    }

    int divide(int x, int y)
    {
        return mul(x, binpow(y, MOD - 2));
    }

    int fact(int num) {
        if (num == 1) return 1;
        return num * fact(num-1);
    }

    bool isPrime(int n)
    {
        if (n <= 1)
            return false;

        for (int i = 2; i <= sqrt(n); i++) {
    
            if (n % i == 0) {
                return false;
                break;
            }
        }
    
        return true;
    }

    bool isPalindrome(string str)
    {
        int l = 0;
        int h = str.size() - 1;
    
        while (h > l)
        {
            if (str[l++] != str[h--])
            {
                return false;
            }
        }
        return true;
    }

    void solve() {
        int n;
        cin>>n;
        vll v;
        int ans = 0;
        f(i,0,n) {
          int a;
          cin>>a;
          ans ^= a;
          v.pb(a);
        }
        if (ans == 0) {
            cout << "YES" << endl;
            return;
        }
        int temp = 0;
        int cnt  = 0;
        f(i,0,n) {
            temp ^= v[i];
            if (temp == ans) {
                cnt++;
                temp = 0;
            } 
        }
        if (cnt > 1) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }

    int32_t main() {
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        int t;
        cin>>t;
        // t = 1;
        while(t--) {
            solve();
        }
    }