import sys

from collections import defaultdict

from itertools import accumulate

from operator import xor





def solve_0(acc):

    MOD = 10 ** 9 + 7

    cnt_0 = 0

    counts = defaultdict(list)

    last_0 = {}

    for a in acc:

        if a == 0:

            cnt_0 += 1

        else:

            cnt = counts[a]

            if len(cnt) == 0:

                cnt.append(1)

                last_0[a] = cnt_0

            else:

                btw_0 = cnt_0 - last_0[a]

                if btw_0 > 0:

                    cnt.append(btw_0)

                    cnt.append(1)

                    last_0[a] = cnt_0

                else:

                    cnt[-1] += 1



    ans = pow(2, cnt_0 - 1, MOD)

    for i, cnt in list(counts.items()):

        dp0 = 1

        dp1 = cnt[0]

        for c0, c1 in zip(cnt[1::2], cnt[2::2]):

            dp0 = (dp0 + dp1 * c0) % MOD

            dp1 = (dp1 + dp0 * c1) % MOD

        ans = (ans + dp1) % MOD



    return ans





def solve_1(acc):

    MOD = 10 ** 9 + 7

    common = acc[-1]

    dp0 = 1

    dp1 = 0

    for a in acc:

        if a == 0:

            dp0 = (dp0 + dp1) % MOD

        elif a == common:

            dp1 = (dp1 + dp0) % MOD

    return dp0





n = int(eval(input()))

aaa = list(map(int, input().split()))

if 'PyPy' in sys.version:

    acc = [0] * n

    t = 0

    for i in range(n):

        t = acc[i] = t ^ aaa[i]

else:

    acc = list(accumulate(aaa, func=xor))

# print(acc)

if acc[-1] == 0:

    print((solve_0(acc)))

else:

    print((solve_1(acc)))

from collections import defaultdict

from itertools import accumulate

from operator import xor





def solve(acc):

    MOD = 10 ** 9 + 7

    cnt0 = 0

    dp0 = defaultdict(lambda: 1)

    dp1 = defaultdict(lambda: 0)

    last_0 = defaultdict(lambda: 0)

    for a in acc:

        if a == 0:

            cnt0 += 1

        else:

            if a not in dp1:

                dp1[a] = 1

                last_0[a] = cnt0

            else:

                bw0 = cnt0 - last_0[a]

                if bw0 > 0:

                    dp0[a] = (dp0[a] + dp1[a] * bw0) % MOD

                    last_0[a] = cnt0

                dp1[a] = (dp1[a] + dp0[a]) % MOD



    if acc[-1] == 0:

        return (pow(2, cnt0 - 1, MOD) + sum(dp1.values())) % MOD

    else:

        return dp0[acc[-1]]





n = int(eval(input()))

aaa = list(map(int, input().split()))

acc = list(accumulate(aaa, func=xor))

print((solve(acc)))

import sys
from collections import defaultdict
from itertools import accumulate
from operator import xor


def solve_0(acc):
    MOD = 10**9 + 7
    cnt_0 = 0
    counts = defaultdict(list)
    last_0 = {}
    for a in acc:
        if a == 0:
            cnt_0 += 1
        else:
            cnt = counts[a]
            if len(cnt) == 0:
                cnt.append(1)
                last_0[a] = cnt_0
            else:
                btw_0 = cnt_0 - last_0[a]
                if btw_0 > 0:
                    cnt.append(btw_0)
                    cnt.append(1)
                    last_0[a] = cnt_0
                else:
                    cnt[-1] += 1
    ans = pow(2, cnt_0 - 1, MOD)
    for i, cnt in list(counts.items()):
        dp0 = 1
        dp1 = cnt[0]
        for c0, c1 in zip(cnt[1::2], cnt[2::2]):
            dp0 = (dp0 + dp1 * c0) % MOD
            dp1 = (dp1 + dp0 * c1) % MOD
        ans = (ans + dp1) % MOD
    return ans


def solve_1(acc):
    MOD = 10**9 + 7
    common = acc[-1]
    dp0 = 1
    dp1 = 0
    for a in acc:
        if a == 0:
            dp0 = (dp0 + dp1) % MOD
        elif a == common:
            dp1 = (dp1 + dp0) % MOD
    return dp0


n = int(eval(input()))
aaa = list(map(int, input().split()))
if "PyPy" in sys.version:
    acc = [0] * n
    t = 0
    for i in range(n):
        t = acc[i] = t ^ aaa[i]
else:
    acc = list(accumulate(aaa, func=xor))
# print(acc)
if acc[-1] == 0:
    print((solve_0(acc)))
else:
    print((solve_1(acc)))

from collections import defaultdict
from itertools import accumulate
from operator import xor


def solve(acc):
    MOD = 10**9 + 7
    cnt0 = 0
    dp0 = defaultdict(lambda: 1)
    dp1 = defaultdict(lambda: 0)
    last_0 = defaultdict(lambda: 0)
    for a in acc:
        if a == 0:
            cnt0 += 1
        else:
            if a not in dp1:
                dp1[a] = 1
                last_0[a] = cnt0
            else:
                bw0 = cnt0 - last_0[a]
                if bw0 > 0:
                    dp0[a] = (dp0[a] + dp1[a] * bw0) % MOD
                    last_0[a] = cnt0
                dp1[a] = (dp1[a] + dp0[a]) % MOD
    if acc[-1] == 0:
        return (pow(2, cnt0 - 1, MOD) + sum(dp1.values())) % MOD
    else:
        return dp0[acc[-1]]


n = int(eval(input()))
aaa = list(map(int, input().split()))
acc = list(accumulate(aaa, func=xor))
print((solve(acc)))

-import sys -def solve_0(acc): +def solve(acc): -    cnt_0 = 0 -    counts = defaultdict(list) -    last_0 = {} +    cnt0 = 0 +    dp0 = defaultdict(lambda: 1) +    dp1 = defaultdict(lambda: 0) +    last_0 = defaultdict(lambda: 0) -            cnt_0 += 1 +            cnt0 += 1 -            cnt = counts[a] -            if len(cnt) == 0: -                cnt.append(1) -                last_0[a] = cnt_0 +            if a not in dp1: +                dp1[a] = 1 +                last_0[a] = cnt0 -                btw_0 = cnt_0 - last_0[a] -                if btw_0 > 0: -                    cnt.append(btw_0) -                    cnt.append(1) -                    last_0[a] = cnt_0 -                else: -                    cnt[-1] += 1 -    ans = pow(2, cnt_0 - 1, MOD) -    for i, cnt in list(counts.items()): -        dp0 = 1 -        dp1 = cnt[0] -        for c0, c1 in zip(cnt[1::2], cnt[2::2]): -            dp0 = (dp0 + dp1 * c0) % MOD -            dp1 = (dp1 + dp0 * c1) % MOD -        ans = (ans + dp1) % MOD -    return ans - - -def solve_1(acc): -    MOD = 10**9 + 7 -    common = acc[-1] -    dp0 = 1 -    dp1 = 0 -    for a in acc: -        if a == 0: -            dp0 = (dp0 + dp1) % MOD -        elif a == common: -            dp1 = (dp1 + dp0) % MOD -    return dp0 +                bw0 = cnt0 - last_0[a] +                if bw0 > 0: +                    dp0[a] = (dp0[a] + dp1[a] * bw0) % MOD +                    last_0[a] = cnt0 +                dp1[a] = (dp1[a] + dp0[a]) % MOD +    if acc[-1] == 0: +        return (pow(2, cnt0 - 1, MOD) + sum(dp1.values())) % MOD +    else: +        return dp0[acc[-1]] -if "PyPy" in sys.version: -    acc = [0] * n -    t = 0 -    for i in range(n): -        t = acc[i] = t ^ aaa[i] -else: -    acc = list(accumulate(aaa, func=xor)) -# print(acc) -if acc[-1] == 0: -    print((solve_0(acc))) -else: -    print((solve_1(acc))) +acc = list(accumulate(aaa, func=xor)) +print((solve(acc)))