#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fr(i,a,b) for(int i=a;i<=b;i++)
#define sz(x) (int)(x.size())
#define vi vector<int>
#define all(v) (v).begin(),(v).end()
#define pb push_back
int binpow(int a, int b)
{
int res = 1;
while(b>0)
{
if(b&1)
res=res*a;
a=a*a;
b>>=1;
}
return res;
}
int32_t main()
{
int n;
cin>>n;
int arr[n];
fr(i,0,n-1)
cin>>arr[i];
int c=0;
vi vect;
for(int bit=0;bit<64;bit++)
{
c=0;
for(int i=0;i<n;i++)
{
if(arr[i]&(1LL<<bit))
c++;
}
if(c%2==0&&c>=2)
{
vect.pb(bit);
}
}
int x=0;
fr(i,0,n-1)
{
x^=arr[i];
}
if(sz(vect)==0)
{
cout<<x<<endl;
return 0;
}
vi v(n,0);
reverse(all(vect));
for(int i=0;i<n;i++)
{
int j=0;
for(;j<sz(vect);j++)
{
if(arr[i]&(1LL<<vect[j]))
{
break;//positon of the first set bit
}
}
for(;j<sz(vect);j++)
{
v[i]+=binpow(2,vect[j]);
}
}
x+=*max_element(all(v));
cout<<x<<endl;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBpbnQgbG9uZyBsb25nCiNkZWZpbmUgZnIoaSxhLGIpIGZvcihpbnQgaT1hO2k8PWI7aSsrKQojZGVmaW5lIHN6KHgpIChpbnQpKHguc2l6ZSgpKQojZGVmaW5lIHZpIHZlY3RvcjxpbnQ+CiNkZWZpbmUgYWxsKHYpICh2KS5iZWdpbigpLCh2KS5lbmQoKQojZGVmaW5lIHBiIHB1c2hfYmFjawppbnQgYmlucG93KGludCBhLCBpbnQgYikgCnsKICAgIGludCByZXMgPSAxOwogICAgd2hpbGUoYj4wKSAKICAgIHsKICAgICAgICBpZihiJjEpCiAgICAgICAgcmVzPXJlcyphOwogICAgICAgIGE9YSphOwogICAgICAgIGI+Pj0xOwogICAgfQogICAgcmV0dXJuIHJlczsKfQppbn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