#include <bits/stdc++.h>
using namespace std;
struct trie {
  struct trie *child[2];
  int cnt;
  trie() {
    memset(child, 0, sizeof(child));
    cnt = 0;
  }
};
struct trie *root;
void insert(bitset<42> bs) {
  struct trie *curr = root;
  for (int i = 41; i >= 0; i--) {
    if (curr->child[bs[i]] == NULL) curr->child[bs[i]] = new trie;
    curr = curr->child[bs[i]];
    curr->cnt++;
  }
}
long long int compare(bitset<42> bs) {
  struct trie *curr = root;
  long long int ans = 0;
  for (long long int i = 41; i >= 0; i--) {
    if (bs[i] == 1) {
      if (curr->child[0] != NULL && curr->child[0]->cnt > 0) {
        ans = (ans + (1LL << i));
        curr = curr->child[0];
      } else
        curr = curr->child[1];
    } else {
      if (curr->child[1] != NULL && curr->child[1]->cnt > 0) {
        ans = (ans + (1LL << i));
        curr = curr->child[1];
      } else
        curr = curr->child[0];
    }
  }
  return ans;
}
void removee(bitset<42> bs) {
  struct trie *curr = root;
  for (int i = 41; i >= 0; i--) {
    curr = curr->child[bs[i]];
    curr->cnt--;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  root = new trie;
  vector<long long int> v, temp;
  insert(bitset<42>(0));
  long long int sum = 0;
  long long int ans = 0;
  for (int i = 1; i <= q; i++) {
    long long int a;
    cin >> a;
    sum ^= a;
    ans = max(ans, sum);
    insert(bitset<42>(sum));
    v.push_back(sum);
    temp.push_back(a);
  }
  reverse(v.begin(), v.end());
  sum = 0;
  for (auto i : v) {
    sum ^= (temp.back());
    removee(bitset<42>(i));
    long long int val = compare(bitset<42>(sum));
    temp.pop_back();
    ans = max(ans, val);
  }
  cout << ans << '\n';
}
