using System;


public class Program
{
    private int N;
    private long[] A;

    public void Solve()
    {
        var sc = new Scanner();
        N = sc.NextInt();
        A = sc.LongArray();

        long xor = 0;

        foreach (var l in A)
        {
            xor ^= l;
        }

        long ans = 0;
        for (int i = 0; i < 60; i++)
        {
            long b = 1L << i;
            if ((xor & b) > 0)
            {
                ans += b;
                for (int j = 0; j < N; j++)
                {
                    if ((A[j] & b) > 0)
                    {
                        A[j] ^= b;
                    }
                }
            }
        }

        ans += MaxSubarrayXOR(A) * 2;

        Console.WriteLine(ans);
    }

    long MaxSubarrayXOR(long[] array)
    {
        int index = 0;
        for (int i = 62; i >= 0; i--)
        {
            long b = 1L << i;
            long max = -1;
            int maxInd = -1;
            for (int j = index; j < array.Length; j++)
            {
                if ((array[j] & b) > 0 && array[j] > max)
                {
                    max = array[j];
                    maxInd = j;
                }
            }
            
            if (max == -1) continue;

            long t = array[index];
            array[index] = array[maxInd];
            array[maxInd] = t;
            
            for (int j = 0; j < array.Length; j++)
            {
                if ((array[j] & b) > 0 && j != index)
                {
                    array[j] ^= max;
                }
            }

            index++;
        }
        long result = 0;
        foreach (long l in array)
        {
            result ^= l;
        }
        return result;
    }

    public static void Main(string[] args)
    {
        new Program().Solve();
    }
}


class Scanner
{
    public Scanner()
    {
        _pos = 0;
        _line = new string[0];
    }

    const char Separator = ' ';
    private int _pos;
    private string[] _line;

    #region スペース区切りで取得

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = Console.ReadLine().Split(Separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region 型変換

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region 配列取得

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = Console.ReadLine().Split(Separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion
}

Measured memory_bytes: 34012