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