#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e17;
const long long MB = 40;
const long long MOD = 1e9 + 7;
const long long maxN = 1e5;
const long long mem = 1e7;
long long zero[mem], one[mem], cnt[mem];
long long root = 1, id = 2;
void add(long long x) {
  long long now = root;
  for (long long i = MB - 1; i >= 0; i--) {
    long long y = (x >> i) & 1;
    if (!y) {
      if (!zero[now]) zero[now] = id++;
      now = zero[now];
    } else {
      if (!one[now]) one[now] = id++;
      now = one[now];
    }
    cnt[now]++;
  }
}
void del(long long x) {
  long long now = root;
  for (long long i = MB - 1; i >= 0; i--) {
    long long y = (x >> i) & 1;
    if (!y) {
      now = zero[now];
    } else {
      now = one[now];
    }
    cnt[now]--;
  }
}
long long get(long long x) {
  long long now = root, res = 0;
  for (long long i = MB - 1; i >= 0; i--) {
    long long y = (x >> i) & 1;
    if (zero[now] && cnt[zero[now]] && (y || !one[now] || !cnt[one[now]]))
      now = zero[now];
    else {
      now = one[now];
      res += (1LL << i);
    }
  }
  return res;
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n + 2);
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  vector<long long> pref(n + 2), suff(n + 2);
  for (long long i = 1; i <= n; i++) {
    pref[i] = pref[i - 1] ^ a[i];
  }
  for (long long i = n; i > 0; i--) {
    suff[i] = suff[i + 1] ^ a[i];
  }
  for (long long i = 0; i <= n + 1; i++) {
    add(suff[i]);
  }
  long long ans = 0;
  for (long long i = 0; i <= n; i++) {
    del(suff[i]);
    ans = max(ans, pref[i] ^ get(pref[i]));
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed;
  cout.precision(12);
  long long t = 1;
  while (t--) solve();
}
