package main

import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
)

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt(A ...*int) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.Atoi(L[i])
  }
}
func NextIntVec(A *[]int) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]int, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.Atoi(l)
  }
}
func NextFloat(A ...*float64) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.ParseFloat(L[i], 64)
  }
}
func NextFloatVec(A *[]float64) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]float64, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.ParseFloat(l, 64)
  }
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func WriteIntVec(A []int) {
  S := make([]string, len(A))
  for i, a := range A {
    S[i] = strconv.Itoa(a)
  }
  Write(strings.Join(S, " "))
}
func Output() {
  _ = writer.Flush()
}

func MaxInt(A ...int) int {
  max := A[0]
  for _, a := range A {
    if max < a { max = a }
  }
  return max
}
func MinInt(A ...int) int {
  min := A[0]
  for _, a := range A {
    if a < min { min = a }
  }
  return min
}
func SumInt(A ...int) int {
  sum := 0
  for _, a := range A {
    sum += a
  }
  return sum
}
func AbsInt(x int) int {
  if x < 0 { x = -x }
  return x
}

type BitSet []uint64
func NewBitSet(N int) *BitSet {
  B := BitSet(make([]uint64, N / 64 + 1))
  return &B
}
func (B *BitSet) Lsh(N int) {
  n, k := N / 64, N % 64
  for i := len((*B)) - 1; 0 <= i; i-- {
    x := i - n
    if x < 0 {
      (*B)[i] = 0
      continue
    }
    (*B)[i] = (*B)[x] << uint(k)
    if 0 < k && 0 < x { (*B)[i] |= (*B)[x - 1] >> uint(64 - k) }
  }
}
func (B *BitSet) Rsh(N int) {
  n, k := N / 64, N % 64
  for i := 0; i < len((*B)); i++ {
    x := i + n
    if len((*B)) <= x {
      (*B)[i] = 0
      continue
    }
    (*B)[i] = (*B)[x] >> uint(k)
    if 0 < k && x < len((*B)) - 1 { (*B)[i] |= (*B)[x + 1] << uint(64 - k) }
  }
}
func (B *BitSet) And(A *BitSet) {
  n := len((*A))
  for i := 0; i < len((*B)); i++ {
    if i == n { break }
    (*B)[i] &= (*A)[i]
  }
}
func (B *BitSet) Or(A *BitSet) {
  n := len((*A))
  for i := 0; i < len((*B)); i++ {
    if i == n { break }
    (*B)[i] |= (*A)[i]
  }
}
func (B *BitSet) Xor(A *BitSet) {
  n := len((*A))
  for i := 0; i < len((*B)); i++ {
    if i == n { break }
    (*B)[i] ^= (*A)[i]
  }
}
func (B *BitSet) ShOr(N int) {
  n, k := N / 64, N % 64
  for i := len((*B)) - 1; 0 <= i; i-- {
    x := i - n
    if x < 0 { break }
    (*B)[i] |= (*B)[x] << uint(k)
    if 0 < k && 0 < x { (*B)[i] |= (*B)[x - 1] >> uint(64 - k) }
  }
}
func (B *BitSet) Get(N int) uint64 {
  n, k := N / 64, N % 64
  return ((*B)[n] >> uint(k)) % 2
}
func (B *BitSet) Set(N, b int) {
  n, k := N / 64, N % 64
  if 0 < b {
    (*B)[n] |= 1 << uint(k)
  } else {
    (*B)[n] &= ^(1 << uint(k))
  }
}

func Maximize(B []*BitSet, C int) int {
  k := 0
  for j := 59; 0 <= j; j-- {
    if 0 < C & (1 << uint(j)) { continue }
    pivot := false
    for i, b := range B[k:] {
      if b.Get(j) == 1 {
        pivot = true
        B[i + k], B[k] = B[k], B[i + k]
        break
      }
    }
    if !pivot { continue }
    for i, b := range B {
      if i == k { continue }
      if b.Get(j) == 0 { continue }
      b.Xor(B[k])
    }
    k++
  }
  for _, b := range B[1:] {
    B[0].Xor(b)
  }
  return int((*B[0])[0]) | C
}

func Solve() {
  var N int
  NextInt(&N)
  var A []int
  NextIntVec(&A)
  B := make([]*BitSet, N)
  C := 0
  for i, a := range A {
    B[i] = NewBitSet(60)
    for _a, j := a, 0; j < 60; _a, j = _a / 2, j + 1 {
      B[i].Set(j, _a % 2)
    }
    C ^= a
  }
  X := Maximize(B, C)
  Write(C ^ X + X)
}

func main() {
  Solve()
  Output()
}

Measured memory_bytes: 10112