#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int N;
vector<int> A;


int main(){
  cin>>N;
  A.resize(N);
  for(int i=0;i<N;i++) cin>>A[i];

  vector<int> B;
  B.resize(N);
  B[0]=A[0];
  for(int i=1;i<N;i++) B[i]=B[i-1]^A[i];
  
  vector<ll> dp((1<<20),1ll),sum((1<<20),0ll);
  vector<ll> zero((1<<20),0ll);

  int z=0;
  for(int i=0;i<N;i++){
      if(B[i]==0) z++;
      else{
          dp[B[i]]=(dp[B[i]]+sum[B[i]]*(z-zero[B[i]])%MOD)%MOD;
          dp[B[i]]=(dp[B[i]]+MOD)%MOD;
          sum[B[i]]=(sum[B[i]]+dp[B[i]])%MOD;
          zero[B[i]]=z;
      }
  }

  if(B.back()!=0) cout<<dp[B.back()]<<endl;
  else{
      ll ans=1;
      for(int i=1;i<z;i++) ans=ans*2%MOD;
      for(int i=0;i<(1<<20);i++) ans=(ans+sum[i])%MOD;
      
      cout<<ans<<endl;
  }


  return 0;
}
