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: N = int(input())
  A = [int(i) for i in input().split()]
  B = [A[0]]
  mod = 10**9 + 7
  for i in range(1, N):
      B.append(B[-1] ^ A[i])
  # print(B)
  if B[-1]:
      table = []
      for i in range(N):
          if B[i] == B[-1]:
              if table:
                  if table[-1][0] == 1:
                      table[-1] = (1, table[-1][1] + 1)
                  else:
                      table.append((1, 1))
              else:
                  table.append((1, 1))
          elif B[i] == 0:
              if table:
                  if table[-1][0] == 0:
                      table[-1] = (0, table[-1][1] + 1)
                  else:
                      table.append((0, 1))
              else:
                  table.append((0, 1))
      l = len(table)
      dp = [[0] * 2 for i in range(l + 1)]
      dp[0][0] = 1
      for i in range(l):
          if table[i][0] == 1:
              dp[i + 1][0] = dp[i][0]
              dp[i + 1][1] = (dp[i][1] + dp[i][0] * table[i][1]) % mod
          else:
              dp[i + 1][1] = dp[i][1]
              dp[i + 1][0] = (dp[i][0] + dp[i][1] * table[i][1]) % mod
      # print(dp)
      # print(table)
      print(dp[l - 1][0])
  else:
      table = [[] for i in range(2**20)]
      s = set()
      ans = 1 / 2
      for i in range(N):
          if B[i] != 0:
              s.add(B[i])
              if table[B[i]]:
                  if table[B[i]][-1][0] == 1:
                      table[B[i]][-1] = (1, table[B[i]][-1][1] + 1)
                  else:
                      table[B[i]].append((1, 1))
              else:
                  table[B[i]].append((1, 1))
          elif B[i] == 0:
              ans *= 2
              for k in s:
                  if table[k]:
                      if table[k][-1][0] == 0:
                          table[k][-1] = (0, table[k][-1][1] + 1)
                      else:
                          table[k].append((0, 1))
                  else:
                      table[k].append((0, 1))
      ans = int(ans)
      for k in s:
          l = len(table[k])
          dp = [[0] * 2 for i in range(l + 1)]
          dp[0][0] = 1
          for i in range(l):
              if table[k][i][0] == 1:
                  dp[i + 1][0] = dp[i][0]
                  dp[i + 1][1] = (dp[i][1] + dp[i][0] * table[k][i][1]) % mod
              else:
                  dp[i + 1][1] = dp[i][1]
                  dp[i + 1][0] = (dp[i][0] + dp[i][1] * table[k][i][1]) % mod
          ans = (ans + dp[l - 1][1]) % mod
      # print(table)
      print(ans % mod)
  
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"}]