MOD = 10**9 + 7 n = int(input()) A = list(map(int, input().split())) B = [] x = 0 for a in A: x ^= a B.append(x) B.pop() tot = 1 cnt = {-1: 1} for b in B: nex = tot tot = nex + tot - cnt.get(b, 0) tot %= MOD cnt[b] = nex print(tot)