#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; int N, A[5001]; short memo[33000][5001]; int solve(int x, int i){ if(memo[x][i] != -1) return 0; if(i == N) return memo[x][i] = 1; return memo[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]; for(int i = 0; i < 33000; i++) for(int j = 0; j <= N; j++) memo[i][j] = -1; cout << solve(0, 0) << endl; return 0; }