#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9 + 1);
const int max_len = 4005000, max_alpha = 2;
int t[max_len][max_alpha];
int szT, root;
int newT() { return ++szT; }
void addTrie(string s) {
  int len = s.size();
  int v = root;
  for (int i = 0; i < len; i++) {
    int c = s[i] - '0';
    if (t[v][c] == 0) t[v][c] = newT();
    v = t[v][c];
  }
}
long long searchT(string s) {
  int len = s.size(), v = root;
  long long d = 0;
  for (int i = 0; i < len; i++) {
    int c = s[i] - '0';
    if (t[v][c] == 0)
      v = t[v][c ^ 1], c = c ^ 1;
    else
      v = t[v][c];
    if (c) d += (1ll << (len - 1 - i));
  }
  return d;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  long long arr[n + 2];
  for (int i = 1; i <= n; i++) cin >> arr[i];
  root = newT();
  long long sum = 0;
  arr[n + 1] = 0;
  arr[0] = 0;
  for (int i = n; i >= 0; i--) {
    sum ^= arr[i];
    string d;
    for (int j = 40; j >= 0; j--) {
      if (sum & (1ll << j))
        d.append("1");
      else
        d.append("0");
    }
    addTrie(d);
  }
  sum = 0;
  long long ans = 0;
  for (int i = 0; i <= n; i++) {
    sum ^= arr[i];
    string d;
    for (int j = 40; j >= 0; j--) {
      if (sum & (1ll << j))
        d.append("0");
      else
        d.append("1");
    }
    long long f = searchT(d);
    ans = max(ans, f ^ sum);
  }
  cout << ans;
}
