#include <bits/stdc++.h>
#define int long long
using namespace std;
int t, x;
signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> t;
    while (t--) {
        cin >> x;
        int sum = 0;
        for (int i = 0; i < x; i++) {
            int n;
            cin >> n;
            sum ^= n;
        }
        cout << (sum != 0 ? "YES\n" : "NO\n");
    }
    return 0;
}