#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; for (int i = 1; i < N; i++){ long long next = sum; sum += MOD - mp[X[i]]; sum += next; sum %= MOD; mp[X[i]] = next; } if (X[N] != 0){ sum += mp[X[N]]; sum %= MOD; } cout << sum << endl; } }