#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF (INT_MAX/3) #define PI (2*acos(0.0)) #define EPS (1e-8) typedef long long ll; typedef unsigned long long ull; map, int> e; int N, A[5001]; int solve(int x, int i){ if(e[pair(x, i)] != 0) return 0; if(i == N){ e[pair(x, i)]++; return 1; } return e[pair(x, i)] = solve(x, i + 1) + solve(x ^ A[i], i + 1); } int main(){ ios_base::sync_with_stdio(0); cin >> N; for(int i = 0; i < N; i++) cin >> A[i]; cout << solve(0, 0) << endl; return 0; }