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+1) prev={} dp[0]=1 for i in range(le): dp[i+1]=dp[i]+dp[i]-(dp[prev[lst[i]]] if lst[i] in prev else 0) if mod: dp[i+1]%=mod prev[lst[i]]=i return dp[le] mod=10**9+7 ans=Subsequence_Count(A,mod) print(ans)