#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 5;
long long a[N], pref[N], suf[N];
typedef struct data {
  data* bit[2];
  long long cnt = 0;
} trie;
trie* head;
void insert(long long x) {
  trie* node = head;
  for (long long i = 40; i >= 0; i--) {
    long long curbit = (x >> i) & 1;
    if (node->bit[curbit] == NULL) {
      node->bit[curbit] = new trie();
    }
    node = node->bit[curbit];
    node->cnt++;
  }
}
void remove(long long x) {
  trie* node = head;
  for (long long i = 40; i >= 0; i--) {
    long long curbit = (x >> i) & 1;
    node = node->bit[curbit];
    node->cnt--;
  }
}
long long maxxor(long long x) {
  trie* node = head;
  long long ans = 0;
  for (long long i = 40; i >= 0; i--) {
    long long curbit = (x >> i) & 1;
    if (node->bit[curbit ^ 1] != NULL && node->bit[curbit ^ 1]->cnt > 0) {
      ans += (1LL << i);
      node = node->bit[curbit ^ 1];
    } else
      node = node->bit[curbit];
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  head = new trie();
  insert(0);
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    pref[i] = pref[i - 1] ^ a[i];
    insert(pref[i]);
  }
  for (long long i = n; i >= 1; i--) suf[i] = suf[i + 1] ^ a[i];
  long long ans = maxxor(0);
  for (long long i = n; i >= 1; i--) {
    remove(pref[i]);
    ans = max(ans, maxxor(suf[i]));
  }
  cout << ans;
  return 0;
}
