#include <bits/stdc++.h>
using namespace std;
long long nxt[6000005][2];
long long sz = 1;
void add(long long x) {
  string s = "";
  while (x > 0) {
    s += (x % 2 + '0');
    x /= 2;
  }
  while (s.size() < 64) s += '0';
  reverse(s.begin(), s.end());
  int v = 0;
  for (char c : s) {
    if (!nxt[v][c - '0']) {
      nxt[v][c - '0'] = sz;
      sz++;
    }
    v = nxt[v][c - '0'];
  }
}
long long fnd(long long x) {
  string s = "";
  while (x > 0) {
    s += (x % 2 + '0');
    x /= 2;
  }
  while (s.size() < 64) s += '0';
  reverse(s.begin(), s.end());
  int v = 0;
  string res = "";
  for (char c : s) {
    if (!nxt[v][(c - '0') ^ 1]) {
      res.push_back(c);
      v = nxt[v][c - '0'];
    } else {
      res.push_back((c - '0') ^ 1 + '0');
      v = nxt[v][(c - '0') ^ 1];
    }
  }
  long long p = 1;
  long long y = 0;
  for (int i = res.size() - 1; i >= 0; i--) {
    y += p * ((res[i] - '0') ^ (s[i] - '0'));
    p *= 2;
  }
  return y;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<long long> a;
  long long cur = 0;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a.push_back(x);
    cur ^= x;
  }
  long long ans = cur;
  long long cur2 = 0;
  add(cur2);
  for (int i = n - 1; i >= 0; i--) {
    cur2 ^= a[i];
    cur ^= a[i];
    add(cur2);
    ans = max(fnd(cur), ans);
  }
  cout << ans;
  return 0;
}
