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: import sys
  
  sys.setrecursionlimit(10**7)
  INF = 10**18
  MOD = 10**9 + 7
  
  
  def LI():
      return [int(x) for x in sys.stdin.readline().split()]
  
  
  def LI_():
      return [int(x) - 1 for x in sys.stdin.readline().split()]
  
  
  def LF():
      return [float(x) for x in sys.stdin.readline().split()]
  
  
  def LS():
      return sys.stdin.readline().split()
  
  
  def II():
      return int(sys.stdin.readline())
  
  
  def SI():
      return input()
  
  
  from collections import Counter
  
  
  def main():
      N = II()
      A = LI()
      acc = []
      tmp = 0
      for a in A:
          tmp = tmp ^ a
          acc.append(tmp)
      cnts = []
      cnt0 = Counter()
      for x in acc:
          cnt0[x] += 1
          if x == 0:
              cnts.append(cnt0)
              cnt0 = Counter()
      se = set([x]) if x != 0 else set(acc)
      ans = 0
      for k in se:
          if k == 0:
              ans = (ans + (2 ** (len(cnts) - 1))) % MOD
              continue
          tmp = 1
          for cnt in cnts:
              tmp = (tmp * (cnt[k] + 1)) % MOD
          ans = (ans + tmp) % MOD
      ans = (ans - len(se) + 1) % MOD
      return ans
  
  
  print(main())
  
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"}]