#include using namespace std; const long long MOD = 1000000007; int main(){ int N; cin >> N; vector A(N); for (int i = 0; i < N; i++){ cin >> A[i]; } vector X(N + 1); X[0] = 0; for (int i = 0; i < N; i++){ X[i + 1] = X[i] ^ A[i]; } bool ok = false; for (int i = 0; i < N; i++){ if (A[i] != 0){ ok = true; } } if (!ok){ cout << N << endl; } else { map mp; mp[0] = 1; long long sum = 1; map pr; pr[0] = 0; for (int i = 1; i < N; i++){ long long next = sum; if (pr.count(X[i])){ if (pr[X[i]] != 0){ next += MOD - mp[X[i]]; } } pr[X[i]] = i; next %= MOD; mp[X[i]] = next; sum += mp[X[i]]; sum %= MOD; } cout << sum << endl; } }