import scala.io.StdIn.readLine object Main{ def ipow(x : Long,n : Long) : Long = { if(x == 0) 1 else if(n % 2 == 0) ipow(x*x,n/2) else x * ipow(x*x,n/2) } def to_bit_str(x : Long) : String = { val bi = (0 to 62).map((i : Int) => if ((x & (1L << i)) != 0) "1" else "0" ).reverse bi.map(_.toString).fold("")(_ + _) } def main(args: Array[String]){ val n = readLine().toLong val a = readLine().split(" ").map(_.toLong) val used = scala.collection.mutable.Set[Int]() val MAXK = 62 for(k <- MAXK to 0 by -1){ val mask = 1L << k val usable = (v : (Long,Int)) => v match { case (e,i) => !used(i) && (e & mask) != 0 } a.zipWithIndex.find(usable) match { case Some((e,i)) => { used += i a.zipWithIndex.filter(usable).map((v) => v match { case (_,i) => i }) .foreach((h) => a(h) = a(h) ^ e); } case None => Unit } } println(ipow(2,a.count(_ != 0))) } }