local mod = 1000000007 local mfl = math.floor local bxor = bit.bxor local function badd(x, y) return (x + y) % mod end local function bsub(x, y) return x < y and x - y + mod or x - y end local n = io.read("*n") local a = {} for i = 1, n do a[i] = io.read("*n") end local asum = {a[1]} for i = 2, n do asum[i] = bxor(asum[i - 1], a[i]) end local summap = {} local t = {} t[0] = 1 local ts = 1 for i = 1, n do if summap[asum[i - 1]] then ts = bsub(ts, t[summap[asum[i - 1]]]) end t[i] = ts ts = badd(ts, t[i]) if 1 < i then summap[asum[i - 1]] = i - 1 end end print(t[n])