import sys readline=sys.stdin.readline from collections import defaultdict N=int(readline()) A=list(map(int,readline().split())) for i in range(1,N-1): A[i]^=A[i-1] A.pop() def Subsequence_Count(lst,mod=0): le=len(lst) dp=[0]*(le+2) prev=defaultdict(lambda:-1) dp[1]=1 for i in range(le): dp[i+2]=dp[i+1]+dp[i+1]-dp[prev[lst[i]]+1] if mod: dp[i+2]%=mod prev[lst[i]]=i return dp[le+1] mod=10**9+7 ans=Subsequence_Count(A,mod) print(ans)