尼姆博弈,计算异或和

#include <iostream>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        long long res=0;
        for(int i=0;i<n;i++){
            int a;
            cin>>a;
            res^=a;
        }
        if(res!=0)cout<<"YES\n";
        else cout<<"NO\n";
    }
    return 0;
}