import std.stdio, std.conv, std.string;
import std.array, std.range, std.algorithm, std.container;
import std.math, std.random, std.bigint, std.datetime, std.format;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

int DEBUG_LEVEL = 0;
void print()(){ writeln(""); }
void print(T, A ...)(T t, lazy A a){ write(t), print(a); }
void print(int level, T, A ...)(T t, lazy A a){ if(level <= DEBUG_LEVEL) print(t, a); }

void main(string[] args){
	if(args.length > 1 && args[1] == "-debug"){
		if(args.length > 2 && args[2].isNumeric) DEBUG_LEVEL = args[2].to!int;
		else DEBUG_LEVEL = 1;
	}
	
	int n = read.to!int;
	long[] as;
	foreach(i; 0 .. n) as ~= read.to!long;
	print!1("as:", as);
	
	long[] sums = [0]; // sum(0 .. i)
	foreach(a; as) sums ~= sums[$ - 1] ^ a;
	print!1("sums:", sums);
	
	
	long[long] xs; // xs[a] はaずつ奇数個に分ける場合の数
	long[long] ys; // ys[a] はxs[a]の累積
	long zcnt; // 今までにあったsum = 0の個数
	long[long] zs; // zs[a] は最後にsum = aが出たときまでにあったsum = 0の個数
	
	/*
	自分が sum = a (a != 0) のときは
	xs[a] = (zcnt - zs[a]) * ys[a] + xs[a]
	として更新
	( = 0 のときはスルー)
	
	全体が = 0 だった場合は最後に全部見て和を取る
	
	*/
	
	foreach(i; 0 .. n + 1){
		if(sums[i] == 0){
			zcnt += 1;
			continue; 
		}
		else{
			long s = sums[i];
			if(s !in xs){
				xs[s] = 1, ys[s] = 0, zs[s] = 0;
			}
			xs[s] += (zcnt - zs[s]) * ys[s], xs[s] %= mod;
			ys[s] += xs[s], ys[s] %= mod;
			zs[s] = zcnt;
		}
		print!1("i:", i, " s:", sums[i], " xs:", xs, " ys:", ys, " zs:", zs, " zcnt:", zcnt);
	}
	
	long ans;
	if(sums[n] != 0) ans = xs[sums[n]];
	else{
		long[] ks = ys.keys;
		foreach(k; ks) ans += ys[k], ans %= mod;
		long t = 1;
		foreach(i; 0 .. zcnt) ans += t, t *= 2, ans %= mod;
	}
	
	ans.writeln;
	
}

const long mod = 1_000_000_007;
/*

*/
