N=int(input()) A=list(map(int,input().split())) C=[0]*(N+1) for i in range(N): C[i+1]=C[i]^A[i] D=dict() D[0]=0 B=[0]*(N+1) for i in range(N): B[i+1]=D.get(C[i+1],0) D[C[i+1]]=i+1 mod=10**9+7 DP=[0]*(N+2) DP[1]=1 for i in range(N): DP[i+2]=(DP[i+1]+DP[i+1]-DP[B[i+1]])%mod print((DP[N+1]-DP[N])%mod)