#include <bits/stdc++.h>
using namespace std;
struct Trie {
  struct Node {
    Node* nxt[2];
    int cnt = 0;
    Node() {
      nxt[0] = nxt[1] = NULL;
      cnt = 0;
    }
  };
  Node* head;
  Trie() { head = new Node(); }
  void insert(long long x) {
    Node* curr = head;
    for (int i = 40; i >= 0; i--) {
      int b = (x >> i) & 1;
      if (!curr->nxt[b]) {
        curr->nxt[b] = new Node();
      }
      curr = curr->nxt[b];
      curr->cnt++;
    }
  }
  long long max_xor(long long x) {
    Node* curr = head;
    long long res = 0;
    for (int i = 40; i >= 0; i--) {
      int b = (x >> i) & 1;
      if (curr->nxt[!b] && curr->nxt[!b]->cnt > 0) {
        curr = curr->nxt[!b];
        res += (1LL << i);
      } else {
        curr = curr->nxt[b];
      }
    }
    return res;
  }
};
void solve() {
  int n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long pre_xor[n];
  pre_xor[0] = (0LL ^ a[0]);
  for (int i = 1; i < n; i++) {
    pre_xor[i] = (a[i] ^ pre_xor[i - 1]);
  }
  long long ans = 0;
  Trie tr_post;
  tr_post.insert(0LL);
  long long post = 0;
  for (int i = n - 1; i >= 0; i--) {
    ans = max(ans, tr_post.max_xor(pre_xor[i]));
    post = (post ^ a[i]);
    tr_post.insert(post);
  }
  ans = max(ans, tr_post.max_xor(0LL));
  cout << ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
