#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define ll long long
#define Vi vector<int>

using namespace std;

const int N=(1<<20)+10,mod=1e9+7;
int n,mx,a[N],ans,sum[N]; Vi p[N];

int dp(Vi x){
	if (!x.size()) return 0;
	int s1=0,s2=0,f=1;
	rep (i,0,(int)x.size()-1){
		f=((ll)s2*sum[x[i]]%mod+mod-s1+1)%mod;
		s1=(s1+(ll)f*sum[x[i]]%mod)%mod;
		s2=(s2+f)%mod;
	}
	return a[n]?f:s2;
}

int main(){
	scanf("%d",&n);
	rep (i,1,n){
		scanf("%d",&a[i]),a[i]^=a[i-1];
		p[a[i]].push_back(i);
		sum[i]=sum[i-1]+(!a[i]);
	}
	if (!a[n]){
		ans=1;
		rep (i,1,(int)p[0].size()-1) ans=(ans+ans)%mod;
	}
	mx=1<<20;
	int st,ed;
	if (a[n]) st=ed=a[n]; else st=1,ed=mx-1;
	rep (i,st,ed) ans=(ans+dp(p[i]))%mod;
	printf("%d\n",ans);
	return 0;
}