#include <bits/stdc++.h>
using namespace std;
const int N = 100050, M = 40;
long long a[N], x[N], y[N];
long long num;
int ID;
bool isr1;
struct trie {
  trie *next[2];
  int id;
  trie() {
    next[0] = next[1] = 0;
    id = -1;
  }
  void insert(int i = M) {
    id = (isr1 ? min((id == -1 ? 10000000 : id), ID) : max(id, ID));
    if (i == -1) return;
    bool ind = num & (1LL << i);
    if (next[ind] == 0) next[ind] = new trie();
    next[ind]->insert(i - 1);
  }
};
long long find(trie *x, trie *y, long long mask = 0, int i = M) {
  if (x->id >= y->id) return 0;
  if (i == -1) return mask;
  long long ans = 0;
  bool b = true;
  if (x->next[0] && y->next[1]) {
    b = false;
    ans = max(ans, find(x->next[0], y->next[1], mask ^ (1LL << i), i - 1));
  }
  if (x->next[1] && y->next[0]) {
    b = false;
    ans = max(ans, find(x->next[1], y->next[0], mask ^ (1LL << i), i - 1));
  }
  if (b && x->next[1] && y->next[1])
    ans = max(ans, find(x->next[1], y->next[1], mask, i - 1));
  if (b && x->next[0] && y->next[0])
    ans = max(ans, find(x->next[0], y->next[0], mask, i - 1));
  return ans;
}
int main() {
  trie r1, r2;
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%I64d", a + i);
  num = 0;
  isr1 = true;
  for (ID = 0; ID <= n; ++ID) {
    num ^= a[ID];
    r1.insert();
  }
  num = 0;
  isr1 = false;
  for (ID = n + 1; ID > 0; --ID) {
    num ^= a[ID];
    r2.insert();
  }
  printf("%I64d", find(&r1, &r2));
  return 0;
}
