output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 A_2 \ldots A_{N}
attempt: #!/usr/bin/env python3
  
  import math, itertools, operator
  from math import *
  from math import factorial as fact
  from itertools import permutations, combinations
  from functools import reduce
  from statistics import mean, median, median_low, median_high, mode
  
  # Before Python 3.5
  from fractions import gcd
  
  import numpy as np
  
  # import scipy, scipy.special
  # from sympy import isprime, nextprime
  # from sympy.ntheory import factorint
  # from sympy import divisors
  
  inf = float("inf")
  
  
  def lcm(a, b):
      return a * b // gcd(a, b)
  
  
  def perm(a, b):
      import scipy.special
  
      return scipy.special.perm(a, b, exact=True)
  
  
  def comb(a, b):
      import scipy.special
  
      return scipy.special.comb(a, b, exact=True)
  
  
  def dfact(n):
      import scipy.special
  
      return scipy.special.factorial2(n, exact=True)
  
  
  def prod(l):
      return reduce(operator.mul, l)
  
  
  def input_ints(inp=input, sep=" ", conv=int):
      return map(conv, inp().split(sep=sep))
  
  
  ################################################################################
  
  N = int(input())
  A = list(input_ints())
  
  dp = np.empty((N))
  
  
  def func(N, A, up_prod, i_start):
      if i_start == N:
          return 1
      if dp[i_start] >= 0:
          return dp[i_start]
      prod = 0
      cnt = 0
      for i in range(i_start, N):
          prod ^= A[i]
          if prod == up_prod:
              cnt += func(N, A, up_prod, i + 1)
      dp[i_start] = cnt
      return cnt
  
  
  prod = 0
  cnt = 0
  for i in range(0, N):
      dp.fill(-1)
      prod ^= A[i]
      cnt += func(N, A, prod, i + 1)
  
  print(int(cnt % (1e9 + 7)))
  
problem_description: Statement
  
  The _beauty_ of a sequence a of length n is defined as a_1 \oplus \cdots
  \oplus a_n, where \oplus denotes the bitwise exclusive or (XOR).
  
  You are given a sequence A of length N. Snuke will insert zero or more
  partitions in A to divide it into some number of non-empty contiguous
  subsequences.
  
  There are 2^{N-1} possible ways to insert partitions. How many of them divide
  A into sequences whose beauties are all equal? Find this count modulo
  10^{9}+7.
samples: [{"input": "3\n    1 2 3", "output": "3\n    \n\nFour ways of dividing A shown below satisfy the condition. The condition is\nnot satisfied only if A is divided into (1),(2),(3).\n\n  * (1,2,3)\n  * (1),(2,3)\n  * (1,2),(3)\n\n* * *"}, {"input": "3\n    1 2 2", "output": "1\n    \n\n* * *"}, {"input": "32\n    0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0", "output": "147483634\n    \n\nFind the count modulo 10^{9}+7.\n\n* * *"}, {"input": "24\n    1 2 5 3 3 6 1 1 8 8 0 3 3 4 6 6 4 0 7 2 5 4 6 2", "output": "292"}]