object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val a = Array.fill(n)(sc.nextLong())

  def func(l:Int,r:Int,left:Long,right:Long):Long = {
    val x = if (r<n-1){
      func(l,r+1,left ^ a(r+1), right + a(r+1))
    } else {
      0
    }
    val y = if (left == right){
      1
    } else {
      0
    }
    val z = if (l<r){
      func2(l+1,r,left ^ a(l), right - a(l))
    } else {
      0
    }
    x + y + z
  }

  def func2(l:Int,r:Int,left:Long,right:Long):Long = {
    val x = if (l<r){
      func2(l+1,r,left ^ a(l), right - a(l))
    } else {
      0
    }
    val y = if (left == right){
      1
    } else {
      0
    }
    x + y
  }
  println(func(0,0,a(0),a(0)))
}