#include #include #include using namespace std; const int N=200005; const int MOD=1000000007; int n; int a[N]; int sum[N]; int f[N]; int main() { scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=1;i<=n;i++) sum[i]=sum[i-1]^a[i]; unordered_mappre; f[0]=1; int s=1; for(int i=1;i<=n;i++) { f[i]=s; if(pre[sum[i]]) f[i]=(f[i]-pre[sum[i]])%MOD; pre[sum[i]]=(pre[sum[i]]+f[i])%MOD; s=(s+f[i])%MOD; } int ans=0; for(int i=1;i<=n;i++) if((sum[i]^sum[n])==0) ans=(ans+f[i])%MOD; ans=(ans+MOD)%MOD; printf("%d",ans); return 0; }