#include <bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back

typedef long long ll;
typedef pair<int, int> pii;
typedef unordered_map<int, int> umap;

const int SZ = 18;

int n;
int a[40];
umap dpp[20], dps[20]; // prefix and suffix

void solve(umap *dp, int n) {
  dp[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    int sum = 0;
    for (int j = i; j > 0; --j) {
      sum += a[j];
      for (auto it : dp[j - 1]) {
	    dp[i][sum ^ it.first] += it.second;
      }
    }
  }
}

int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i)
    cin >> a[i];
  if (n <= SZ) {
    solve(dpp, n);
    cout << dpp[n][0] << endl;
  } else {
    solve(dpp, SZ);
    reverse(a, a + n + 2); // + 2 means zero before and after sequence
    solve(dps, n - SZ);
    reverse(a, a + n + 2);
    ll res = 0;
    for (auto it : dpp[SZ]) {
      if (dps[n - SZ].find(it.first) != dps[n - SZ].end()) {
	    res += it.second * 1ll * dps[n - SZ][it.first];
      }
    }
    for (int i = 1; i <= SZ; ++i) {
      for (int j = SZ + 1; j <= n; ++j) {
        int sum = 0;
        for (int k = i; k <= j; ++k) { // why not?
          sum += a[k];
        }
        for (auto it : dpp[i - 1]) {
          if (dps[n - j].find(it.first ^ sum) != dps[n - j].end()) {
            res += it.second * 1ll * dps[n - j][it.first ^ sum];
          }
        }
      }
    }
    cout << res << endl;
  }
  return 0;
}