from collections import defaultdict N = int(input()) A = [0]+list(map(int, input().split())) d = defaultdict(int) xor = 0 B = [0]*(N+1) for i in range(N+1): xor ^= A[i] B[i] = d[xor] d[xor] = i dp = [0]*(N+1) mod = 10**9+7 dp[1] = 1 for i in range(1,N): dp[i+1] = (2*dp[i]-dp[B[i]])%mod print(dp[-1])