#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<ll,ll> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
#define INF 100000000000000000
ll n,a[500005],ans,z,sz[500005];
vector<ll>cm,s[500005];
int main(void){
	scanf("%lld",&n);
	cm.PB(0);
	for(int i=0;i<n;i++){
		scanf("%lld",a+i);
		if(i>0)a[i]=a[i-1]^a[i];
		if(a[i]==0)z++,sz[i]++;
		cm.PB(a[i]);
		if(i>0)sz[i]+=sz[i-1];
	}
	sort(cm.begin(),cm.end());
	cm.erase(unique(cm.begin(),cm.end()),cm.end());
	for(int i=0;i<n;i++){
		a[i]=lower_bound(cm.begin(),cm.end(),a[i])-cm.begin();
		s[a[i]].PB(i);
	}
	if(a[n-1]==0){
		ll tp=1;
		for(int i=0;i<z-1;i++)tp=tp*2LL%M;
		ans=(ans+tp)%M;
		for(int i=1;i<cm.size();i++){
			ll x=1,y=1;
			for(int j=1;j<s[i].size();j++){
				ll p=sz[s[i][j]]-sz[s[i][j-1]];
				y=(y+x*p)%M;
				x=(x+y)%M;
			}
			ans=(ans+x)%M;
		}
	}else{
		ll x=1,y=1;
		for(int j=1;j<s[a[n-1]].size();j++){
			ll p=sz[s[a[n-1]][j]]-sz[s[a[n-1]][j-1]];
			y=(y+x*p)%M;
			x=(x+y)%M;
		}
		ans=(ans+y)%M;
	}
	cout<<ans<<endl;
}