//Solution by Zhusupov Nurlan #include <iostream> #include <cassert> #include <cstdio> #include <cstdlib> #include <cstring> #include <cctype> #include <cmath> #include <algorithm> #include <set> #include <vector> #include <map> #include <string> #include <stack> #include <queue> #include <ctime> using namespace std; typedef long long LL; typedef map<string , int> MSI; typedef vector<int> VI; typedef pair<int, int> PII; #define pb(x) push_back(x) #define sqr(x) ((x) * (x)) #define F first #define S second #define SZ(t) ((int) t.size()) #define len(t) ((int) t.length()) #define base LL(1e9 + 7) #define fname "" #define sz 1000 * 200 #define EPS (1e-8) #define INF ((int)1e9 + 9) #define write(xx) printf("%d" , xx); #define readln(xx) getline(cin , xx) #define read(xx) scanf("%d" , &xx) #define mp make_pair const double PI = acos(-1.0); LL ans, h, n, x[sz], a[sz]; vector<LL> g[sz], d[sz]; map <pair<LL, LL>, LL> was; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; x[i] = x[i - 1] + a[i]; } g[0].pb(0); d[0].pb(1); for (int i = 0; i <= n; i++) { for (int j = i + 1; j <= n; j++) { for (int r = 0; r < g[i].size(); r++) { h = g[i][r] ^ (x[j] - x[i]); if (!was[mp(j, h)]) { was[mp(j, h)] = d[j].size(); g[j].pb(h); d[j].pb(d[i][r]); } else d[j][was[mp(j, h)]] += d[i][r]; } } } for (int i = 0; i < g[n].size(); i++) if (g[n][i] == 0) ans += d[n][i]; cout << ans; }