#include <bits/stdc++.h> typedef long long ll; #define get(a) scanf("%ld", &a) #define repVector(v) for( auto it = v.begin(); it != v.end(); it++ ) #define all(c) (c).begin(), (c).end() #define pb push_back #define FOR(i,a,b) for( ll i = a; i <= b; i++ ) #define ROF(i,a,b) for( ll i = a; i >= b; i-- ) #define debug(x) cerr << "[DEBUG] " << #x << " = " << x << endl #define matrix vector< vector<ll> > #define F first #define S second #define mp make_pair #define L 2*r #define R 2*r+1 #define INPFILE freopen("input.in","r",stdin) #define BOOST ios_base::sync_with_stdio(false); cin.tie(NULL) using namespace std; ll v[50] = {0}; ll n, ans = 0; map< pair<ll,ll>, ll > dp; ll rec( ll x, ll sum ) { // debug(x); debug(sum); if( x > n && sum == 0 ) return 1; if( x > n ) return 0; if( dp.find( mp(x,sum) ) != dp.end() ) return dp[ mp(x,sum) ]; ll val = 0, q = 0; FOR(i,x,n) { val += v[i]; q += rec( i+1, (sum^val) ); } return dp[ mp(x,sum) ] = q; } int main() { cin >> n; FOR(i,1,n) cin >> v[i]; cout << rec(1,0); }