#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ff first
#define ss second
#define vi vector<ll>
#define print(v) for (auto it : v) cout << it << " "; cout << endl;
#define all(v) v.begin(), v.end()
#define read(v) for(auto &it:v) cin>>it;
#define Faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using namespace std;
const ll mod = 998244353, mx = 1e5 + 10;
void ravana()
{
ll n; cin >> n;
vi v(n); read(v);
vi pref(n + 1, 0);
for (ll i = 0; i < n; i++)
{
pref[i + 1] = pref[i] ^ v[i];
}
ll count = 0;
for (ll i = 1; i < n; i++)
{
ll x = pref[i];
ll y = pref[n] ^ pref[i];
if (x == y)
count++;
//cout << pref[i] << " " << x << " " << y << endl;
}
cout << count << endl;
}
signed main()
{
auto begin = std::chrono::high_resolution_clock::now();
Faster;
//prec();
ll t = 1;
cin >> t;
for (ll i = 1; i <= t; ++i)
{
ravana();
}
auto end = std::chrono::high_resolution_clock::now();
auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin);
cerr << "Time measured: " << elapsed.count() * 1e-9 << " seconds.\n";
return 0;
}