#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <map> using namespace std; map< pair<long long int, long long int>, int > M, M1; int main() { int N; cin >> N; long long int A; cin >> A; M.insert({{0, A}, 1}); for (int i = 1; i < N; i++) { cin >> A; for (auto it = M.begin(); it != M.end(); it++) { pair<long long, long long> a = it->first, b; long long c = it->second; b.first = a.first^a.second; b.second = A; if (M1.find(b) != M1.end()) { M1[b] += c; } else { M1[b] = c; } b.first = a.first; b.second = a.second + A; if (M1.find(b) != M1.end()) { M1[b] += c; } else { M1[b] = c; } } M.clear(); M = M1; M1.clear(); } long long ans = 0; for (auto it = M.begin(); it != M.end(); it++) { pair<long long, long long> a = it->first, b; long long c = it->second; if (a.first == a.second) ans += c; } cout << ans << '\n'; /* Enter your code here. Read input from STDIN. Print output to STDOUT */ return 0; }