import scala.io.StdIn.readLine object Main{ 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.par.zipWithIndex.find(usable) match { case Some((e,i)) => { used += i a.par.zipWithIndex.filter(usable) .foreach({case (_,h) => a(h) = a(h) ^ e}); } case None => Unit } } println(1L << a.count(_ != 0)) } }