#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long inf = 1e14;
struct Node {
  Node* left;
  Node* right;
  int count;
  long long val;
  Node() {
    left = right = NULL;
    count = 0;
  }
};
Node* root;
void add(long long u, int depth = 50, Node* node = root) {
  if (depth == -1) {
    node->val = u;
    node->count++;
    return;
  }
  if ((u >> depth) & 1) {
    if (node->right == NULL) node->right = new Node();
    add(u, depth - 1, node->right);
  } else {
    if (node->left == NULL) node->left = new Node();
    add(u, depth - 1, node->left);
  }
  node->count = 0;
  if (node->left != NULL) node->count += node->left->count;
  if (node->right != NULL) node->count += node->right->count;
}
void remove(long long u, int depth = 50, Node* node = root) {
  assert(node != NULL);
  if (depth == -1) {
    node->count--;
    assert(node->count >= 0);
    return;
  }
  if ((u >> depth) & 1) {
    assert(node->right != NULL);
    remove(u, depth - 1, node->right);
  } else {
    assert(node->left != NULL);
    remove(u, depth - 1, node->left);
  }
  node->count = 0;
  if (node->left != NULL) {
    node->count += (node->left)->count;
  }
  if (node->right != NULL) {
    node->count += (node->right)->count;
  }
}
long long get(long long u, int depth = 50, Node* node = root) {
  assert(node != NULL);
  if (depth == -1) {
    return node->val;
  }
  int bit = (u >> depth) & 1;
  if (bit == 0) {
    if (node->right != NULL && node->right->count)
      return get(u, depth - 1, node->right);
    else {
      assert(node->left != NULL);
      return get(u, depth - 1, node->left);
    }
  } else {
    if (node->left != NULL && node->left->count)
      return get(u, depth - 1, node->left);
    else {
      assert(node->right != NULL);
      return get(u, depth - 1, node->right);
    }
  }
  assert(false);
  return -1;
}
int n;
long long a[N];
void brute() {
  long long left = 0;
  long long res = 0;
  for (int i = 0; i < n; i++) {
    left ^= a[i];
    long long cur = 0, right = 0;
    res = max(res, left);
    for (int j = n - 1; j > i; j--) {
      right ^= a[j];
      res = max(res, left ^ right);
    }
  }
  cout << "max from brute = " << res << endl;
}
int main() {
  root = new Node();
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long x = 0, res = 0;
  for (int i = n - 1; i >= 0; i--) {
    x ^= a[i];
    res = max(res, x);
    add(x);
  }
  res = max(get(0), res);
  long long cur = 0;
  for (int i = 0; i < n - 1; i++) {
    remove(x);
    x ^= a[i];
    cur ^= a[i];
    res = max(res, cur);
    long long best_right = get(cur);
    long long best_left = cur;
    res = max(res, best_left ^ best_right);
  }
  cout << res << endl;
  return 0;
}
