N = gets.to_i
M = 10 ** 9 + 7

a_list = gets.strip.split(/ /).collect(&:to_i)

total = a_list.inject(:^)

zero_counts = []

x = 0
zero_count = 0
x_table = {}
a_list.each_with_index{|a, i|
	x ^= a
	if x == 0
		zero_count += 1
	end
	zero_counts << zero_count
	if l = x_table[x]
		l << x
	else
		x_table[x] = [i]
	end
}

r = x

count = 0
x_table.each{|x, list|
	cz = 1
	ca = 0
	prev = 0
	list.each{|i|
		z = zero_counts[i] - prev
		new_ca = (ca + cz) % M
		new_cz = (cz + ca * z) % M
		ca = new_ca
		cz = new_cz
		prev = zero_counts[i]
	}
	
	if r == 0
		count = (count + cz) % M
	elsif x == r
		count = (count + ca) % M
	end
}
puts count
