# Python program to find  

# maximum XOR subset 

  

# Number of bits to  

# represent int 

INT_BITS=61

   

# Function to return 

# maximum XOR subset 

# in set[] 

def maxSubarrayXOR(set,n): 

  

    # Initialize index of 

    # chosen elements 

    index = 0

   

    # Traverse through all 

    # bits of integer  

    # starting from the most 

    # significant bit (MSB) 

    for i in range(INT_BITS-1,-1,-1): 

      

        # Initialize index of 

        # maximum element and 

        # the maximum element 

        maxInd = index 

        maxEle = -2147483648

        for j in range(index,n): 

          

            # If i'th bit of set[j] 

            # is set and set[j] is  

            # greater than max so far. 

            if ( (set[j] & (1 << i)) != 0 

                     and set[j] > maxEle ): 

                  

                maxEle = set[j] 

                maxInd = j 

          

        # If there was no  

        # element with i'th 

        # bit set, move to 

        # smaller i 

        if (maxEle ==-2147483648): 

            continue

   

        # Put maximum element 

        # with i'th bit set  

        # at index 'index' 

        temp=set[index] 

        set[index]=set[maxInd] 

        set[maxInd]=temp 

   

        # Update maxInd and  

        # increment index 

        maxInd = index 

   

        # Do XOR of set[maxIndex] 

        # with all numbers having 

        # i'th bit as set. 

        for j in range(n): 

          

            # XOR set[maxInd] those 

            # numbers which have the 

            # i'th bit set 

            if (j != maxInd and

               (set[j] & (1 << i)) != 0): 

                set[j] = set[j] ^ set[maxInd] 

          

   

        # Increment index of 

        # chosen elements 

        index=index + 1

      

   

    # Final result is  

    # XOR of all elements 

    res = 0

    for i in range(n): 

        res =res ^ set[i] 

    return res 

  

  

# This code is contributed 

# by Anant Agarwal. 





# coding: utf-8

# Your code here!



import sys

sys.setrecursionlimit(10**6)

readline = sys.stdin.readline #文字列入力のときは注意



#n = int(input())

#n,k = [int(i) for i in readline().split()]



n = int(eval(input()))

a = [int(i) for i in readline().split()]



res = [0]*60

for i in a:

    b = bin(i)[:1:-1]

#    print(b)

    for j,c in enumerate(b):

        if c == "1": res[j] += 1



omask = 0

emask = 0

for i,c in enumerate(res):

    if c%2: omask |= 1<<i

    elif c: emask |= 1<<i



#print(bin(omask)[2:])

#print(bin(emask)[2:])

for i in range(n):

    a[i] &= emask



res = maxSubarrayXOR(a, n)

#print(bin(res)[2:]) 





print((omask + res*2))

















# coding: utf-8

# Your code here!



import sys

sys.setrecursionlimit(10**6)

readline = sys.stdin.readline #文字列入力のときは注意



n = int(eval(input()))

a = [int(i) for i in readline().split()]



from functools import reduce

from operator import xor



NMAX = 62

omask = reduce(xor,a)

emask = (1<<NMAX)-1

emask ^= omask



for i in range(n):

    a[i] &= emask



k = 0

for i in range(NMAX,-1,-1):

    for j in range(k,n):

        if a[j] & (1<<i):

            if j != k: a[j], a[k] = a[k], a[j]

            for l in range(n):

                if l != k and a[l] & (1<<i): a[l] ^= a[k]

            k += 1

            break





print((omask + 2*reduce(xor,a)))

















# Python program to find
# maximum XOR subset
# Number of bits to
# represent int
INT_BITS = 61
# Function to return
# maximum XOR subset
# in set[]
def maxSubarrayXOR(set, n):
    # Initialize index of
    # chosen elements
    index = 0
    # Traverse through all
    # bits of integer
    # starting from the most
    # significant bit (MSB)
    for i in range(INT_BITS - 1, -1, -1):
        # Initialize index of
        # maximum element and
        # the maximum element
        maxInd = index
        maxEle = -2147483648
        for j in range(index, n):
            # If i'th bit of set[j]
            # is set and set[j] is
            # greater than max so far.
            if (set[j] & (1 << i)) != 0 and set[j] > maxEle:
                maxEle = set[j]
                maxInd = j
        # If there was no
        # element with i'th
        # bit set, move to
        # smaller i
        if maxEle == -2147483648:
            continue
        # Put maximum element
        # with i'th bit set
        # at index 'index'
        temp = set[index]
        set[index] = set[maxInd]
        set[maxInd] = temp
        # Update maxInd and
        # increment index
        maxInd = index
        # Do XOR of set[maxIndex]
        # with all numbers having
        # i'th bit as set.
        for j in range(n):
            # XOR set[maxInd] those
            # numbers which have the
            # i'th bit set
            if j != maxInd and (set[j] & (1 << i)) != 0:
                set[j] = set[j] ^ set[maxInd]
        # Increment index of
        # chosen elements
        index = index + 1
    # Final result is
    # XOR of all elements
    res = 0
    for i in range(n):
        res = res ^ set[i]
    return res


# This code is contributed
# by Anant Agarwal.
# coding: utf-8
# Your code here!
import sys

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline  # 文字列入力のときは注意
# n = int(input())
# n,k = [int(i) for i in readline().split()]
n = int(eval(input()))
a = [int(i) for i in readline().split()]
res = [0] * 60
for i in a:
    b = bin(i)[:1:-1]
    #    print(b)
    for j, c in enumerate(b):
        if c == "1":
            res[j] += 1
omask = 0
emask = 0
for i, c in enumerate(res):
    if c % 2:
        omask |= 1 << i
    elif c:
        emask |= 1 << i
# print(bin(omask)[2:])
# print(bin(emask)[2:])
for i in range(n):
    a[i] &= emask
res = maxSubarrayXOR(a, n)
# print(bin(res)[2:])
print((omask + res * 2))

# coding: utf-8
# Your code here!
import sys

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline  # 文字列入力のときは注意
n = int(eval(input()))
a = [int(i) for i in readline().split()]
from functools import reduce
from operator import xor

NMAX = 62
omask = reduce(xor, a)
emask = (1 << NMAX) - 1
emask ^= omask
for i in range(n):
    a[i] &= emask
k = 0
for i in range(NMAX, -1, -1):
    for j in range(k, n):
        if a[j] & (1 << i):
            if j != k:
                a[j], a[k] = a[k], a[j]
            for l in range(n):
                if l != k and a[l] & (1 << i):
                    a[l] ^= a[k]
            k += 1
            break
print((omask + 2 * reduce(xor, a)))

-# Python program to find -# maximum XOR subset -# Number of bits to -# represent int -INT_BITS = 61 -# Function to return -# maximum XOR subset -# in set[] -def maxSubarrayXOR(set, n): -    # Initialize index of -    # chosen elements -    index = 0 -    # Traverse through all -    # bits of integer -    # starting from the most -    # significant bit (MSB) -    for i in range(INT_BITS - 1, -1, -1): -        # Initialize index of -        # maximum element and -        # the maximum element -        maxInd = index -        maxEle = -2147483648 -        for j in range(index, n): -            # If i'th bit of set[j] -            # is set and set[j] is -            # greater than max so far. -            if (set[j] & (1 << i)) != 0 and set[j] > maxEle: -                maxEle = set[j] -                maxInd = j -        # If there was no -        # element with i'th -        # bit set, move to -        # smaller i -        if maxEle == -2147483648: -            continue -        # Put maximum element -        # with i'th bit set -        # at index 'index' -        temp = set[index] -        set[index] = set[maxInd] -        set[maxInd] = temp -        # Update maxInd and -        # increment index -        maxInd = index -        # Do XOR of set[maxIndex] -        # with all numbers having -        # i'th bit as set. -        for j in range(n): -            # XOR set[maxInd] those -            # numbers which have the -            # i'th bit set -            if j != maxInd and (set[j] & (1 << i)) != 0: -                set[j] = set[j] ^ set[maxInd] -        # Increment index of -        # chosen elements -        index = index + 1 -    # Final result is -    # XOR of all elements -    res = 0 -    for i in range(n): -        res = res ^ set[i] -    return res - - -# This code is contributed -# by Anant Agarwal. -# n = int(input()) -# n,k = [int(i) for i in readline().split()] -res = [0] * 60 -for i in a: -    b = bin(i)[:1:-1] -    #    print(b) -    for j, c in enumerate(b): -        if c == "1": -            res[j] += 1 -omask = 0 -emask = 0 -for i, c in enumerate(res): -    if c % 2: -        omask |= 1 << i -    elif c: -        emask |= 1 << i -# print(bin(omask)[2:]) -# print(bin(emask)[2:]) +from functools import reduce +from operator import xor + +NMAX = 62 +omask = reduce(xor, a) +emask = (1 << NMAX) - 1 +emask ^= omask -res = maxSubarrayXOR(a, n) -# print(bin(res)[2:]) -print((omask + res * 2)) +k = 0 +for i in range(NMAX, -1, -1): +    for j in range(k, n): +        if a[j] & (1 << i): +            if j != k: +                a[j], a[k] = a[k], a[j] +            for l in range(n): +                if l != k and a[l] & (1 << i): +                    a[l] ^= a[k] +            k += 1 +            break +print((omask + 2 * reduce(xor, a)))