import scala.io.StdIn.readLine import scala.util.control.Breaks 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).sorted.distinct.reverse val MAXK = 62 val used = scala.collection.mutable.Set[Int]() for(k <- 0 to MAXK){ val mask = 1L << (MAXK-k) val b = new Breaks 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 for((c,h) <- a.zipWithIndex){ if(!used(h) && ((c & mask) != 0)){ a(h) = a(h) ^ e } } } case None => Unit } } println(ipow(2,a.distinct.count(_ != 0))) } }