mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) cs = [0] * (N+1) for i in range(N): cs[i+1] = cs[i] ^ A[i] val = {} left = [0] * (N+1) for i in range(1, N+1): v = cs[i] if v not in val: val[v] = [i] else: left[i] = val[v][-1] val[v].append(i) dp = [0] * (N+1) dp[0] = 1 for i in range(1, N+1): l = left[i] if l and i != N: dp[i] = (dp[i-1] + (dp[i-1] - dp[l-1])%mod)%mod if cs[i] == 0: dp[i] = (dp[i] + 1)%mod else: dp[i] = (dp[i-1] * 2)%mod print((dp[-1] - dp[-2])%mod) if __name__ == '__main__': main()