#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};





int main(){
    int n;cin >> n;
    vector<LL> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<int> cum(n+1,0);
    for (int i = 0; i < n; i++) {
        cum[i+1] = cum[i] ^ a[i];
    }
    int x = cum[n];
    if(x){
        vector<LL> dp(2,0);
        dp[0] = 1;
        for (int i = 0; i <= n; i++) {
            if(cum[i]==x){
                dp[1] = (dp[0] + dp[1])%mod;
            }
            else if(cum[i]==0){
                dp[0] = (dp[1] + dp[0])%mod;
            }
        }
        cout << dp[0] << endl;
    }
    else{
        LL ans = 1;
        for (int i = 1; i < n; i++) {
            if(cum[i]==0) ans = (2 * ans)%mod;
        }
        vector<vector<LL>> dp((1<<22),vector<LL>(2,0));
        vector<LL> count((1<<22),0);
        LL c = 0;
        for (int i = 0; i <= (1<<21); i++) {
            dp[i][0] = 1;
        }
        for (int i = 1; i <= n; i++) {
            int k = cum[i];
            if(k==0) c++;
            else{
                dp[k][0] = ((c-count[k]) * dp[k][1] + dp[k][0])%mod;
                ans = (ans + dp[k][0])%mod;
                dp[k][1] = (dp[k][0] + dp[k][1])%mod;
                count[k] = c;
            }
        }
        cout << ans << endl;
    }
    return 0;
}
