N = int(eval(input()))

A = [int(i) for i in input().split()] 

mod = 10**9 + 7



b = [0]*N #

b[0] = A[0]

for n in range(1,N):

    b[n] = A[n] ^ b[n-1]

#print('累積論理和',b)

m = max(b)

dp = [[0]*(m+1) for j in range(2)]

dp[0] = [True]*(m+1)

dp[1] = [False]*(m+1)

cnt = [0]*(m+1)

z = 0



for i in range(N):

    if b[i] == 0:

        z +=1

    dp[0][b[i]] += dp[1][b[i]]*(z-cnt[b[i]])

    dp[0][b[i]] %= mod

    dp[1][b[i]] += dp[0][b[i]]

    dp[1][b[i]] %= mod

    cnt[b[i]] = z





if b[N-1]:

    print((dp[0][b[N-1]]))

else:

    ans = pow(2, z-1, mod)

    for i in range(1,m+1):

        ans += dp[1][i]

        ans %= mod

    print(ans)
N = int(eval(input()))

A = [int(i) for i in input().split()] 

mod = 10**9 + 7



b = [0]*N 

b[0] = A[0]

for n in range(1,N):

    b[n] = A[n] ^ b[n-1]

#print('累積論理和',b)

m = max(b)

dp = [[0]*(m+1) for j in range(2)]

dp[0] = [1]*(m+1)

cnt = [0]*(m+1)

z = 0



for i in range(N):

    if b[i] == 0:

        z +=1

    dp[0][b[i]] += dp[1][b[i]]*(z-cnt[b[i]])

    dp[0][b[i]] %= mod

    dp[1][b[i]] += dp[0][b[i]]

    dp[1][b[i]] %= mod

    cnt[b[i]] = z





if b[N-1]:

    print((dp[0][b[N-1]]))

else:

    ans = pow(2, z-1, mod)

    for i in range(1,m+1):

        ans += dp[1][i]

        ans %= mod

    print(ans)
N = int(eval(input()))
A = [int(i) for i in input().split()]
mod = 10**9 + 7
b = [0] * N  #
b[0] = A[0]
for n in range(1, N):
    b[n] = A[n] ^ b[n - 1]
# print('累積論理和',b)
m = max(b)
dp = [[0] * (m + 1) for j in range(2)]
dp[0] = [True] * (m + 1)
dp[1] = [False] * (m + 1)
cnt = [0] * (m + 1)
z = 0
for i in range(N):
    if b[i] == 0:
        z += 1
    dp[0][b[i]] += dp[1][b[i]] * (z - cnt[b[i]])
    dp[0][b[i]] %= mod
    dp[1][b[i]] += dp[0][b[i]]
    dp[1][b[i]] %= mod
    cnt[b[i]] = z
if b[N - 1]:
    print((dp[0][b[N - 1]]))
else:
    ans = pow(2, z - 1, mod)
    for i in range(1, m + 1):
        ans += dp[1][i]
        ans %= mod
    print(ans)

N = int(eval(input()))
A = [int(i) for i in input().split()]
mod = 10**9 + 7
b = [0] * N
b[0] = A[0]
for n in range(1, N):
    b[n] = A[n] ^ b[n - 1]
# print('累積論理和',b)
m = max(b)
dp = [[0] * (m + 1) for j in range(2)]
dp[0] = [1] * (m + 1)
cnt = [0] * (m + 1)
z = 0
for i in range(N):
    if b[i] == 0:
        z += 1
    dp[0][b[i]] += dp[1][b[i]] * (z - cnt[b[i]])
    dp[0][b[i]] %= mod
    dp[1][b[i]] += dp[0][b[i]]
    dp[1][b[i]] %= mod
    cnt[b[i]] = z
if b[N - 1]:
    print((dp[0][b[N - 1]]))
else:
    ans = pow(2, z - 1, mod)
    for i in range(1, m + 1):
        ans += dp[1][i]
        ans %= mod
    print(ans)

-b = [0] * N  # +b = [0] * N -dp[0] = [True] * (m + 1) -dp[1] = [False] * (m + 1) +dp[0] = [1] * (m + 1)