#include <bits/stdc++.h>
using namespace std;

struct base{
    #define type long long
    #define log 60
    type d[log+1] = {};
    bool insert(type x){
        for(int i=log; ~i; i--) if((x>>i)&1){
            if(!d[i]){
                d[i] = x;
                break;
            }
            x ^= d[i];
        }
        return x;
    }
    type max(){
        type ret = 0;
        for(int i=log; ~i; i--)
            if((ret^d[i]) > ret)
                ret ^= d[i];
        return ret;
    }
};

int main()
{
    int n;
    scanf("%d",&n);

    long long xo = 0;
    vector <long long> v(n) ,prt(60 ,0);
    for(auto&a : v){
        scanf("%lld",&a) ,xo ^= a;
        for(int b=0; b<60; b++)
            prt[b] ^= (a>>b)&1;
    }

    base h;
    for(auto&a : v){
        for(int b=0; b<60; b++)
            a &= ~(prt[b]<<b);
        h.insert(a);
    }

    long long mx = h.max();
    printf("%lld\n",(xo^mx)+mx);
}

#include <bits/stdc++.h>

#define MIN_INT -2147483648
#define MAX_INT 2147483647
#define MIN_LONG -9223372036854775808L
#define MAX_LONG 9223372036854775807L

#define long long long int

using namespace std;

// @author: pashka

int main() {
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<long> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    long s = 0;
    for (long x : a) s ^= x;
    vector<long> b(n - 1);
    for (int i = 0; i < n - 1; i++) {
        b[i] = a[i] & (~s);
    }
    sort(b.begin(), b.end());
    reverse(b.begin(), b.end());
    vector<long> q;
    long c = 0;
    for (long x : b) {
        for (long y : q) {
            x = min(x, x ^ y);
        }
        if (x > 0) {
            q.push_back(x);
            c = max(c, c ^ x);
        }
    }
    s += c * 2;
    cout << s;

    return 0;
}