#include<bits/stdc++.h>
#define N 100007
using namespace std;
int n,a[N],p[37],ans,ans3;
signed main () {
freopen("a.in","r",stdin);
scanf("%d",&n);
for (int i=1;i<=n;i++) scanf("%d",a+i),ans^=a[i];
for (int i=1;i<=n;i++) {
for (int j=30;~j;j--) if (a[i]&(1<<j)){
if (!p[j]) {p[j]=a[i]; break;}
a[i]^=p[j];
}
}
ans3=0;
for (int j=30;~j;j--) {
if ((ans >>j)&1) continue;
if ((ans3>>j)&1) continue;
ans3^=p[j];
}
printf("%d\n",ans3&((1<<31)-ans-1));
}