#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
long long LCM(long long a, long long b) { return a * (b / GCD(a, b)); }
const double EPS = 10e-9;
const double INF = (1LL << 30);
using namespace std;
class node {
 public:
  int num;
  node *one;
  node *zero;
  node(int n) : one(0), zero(0), num(n) { ; }
};
void partition(int bit, vector<long long> &nums, vector<long long> &left,
               vector<long long> &right) {
  for (int i = 0; i < (nums.size()); ++i) {
    if (nums[i] & (1LL << bit))
      left.push_back(nums[i]);
    else
      right.push_back(nums[i]);
  }
}
node *build(int bit, vector<long long> &nums) {
  vector<long long> left, right;
  node *nd = new node(nums.size());
  partition(bit, nums, left, right);
  if (bit == 0) {
    if (left.size() != 0) nd->one = new node(left.size());
    if (right.size() != 0) nd->zero = new node(right.size());
    return nd;
  }
  if (left.size() != 0) {
    nd->one = build(bit - 1, left);
  }
  if (right.size() != 0) {
    nd->zero = build(bit - 1, right);
  }
  return nd;
}
long long find(long long num, int bit, node *nd) {
  if (bit == -1) return 0;
  long long found;
  if (num & (1LL << bit)) {
    if (nd->zero && nd->zero->num > 0) {
      found = find(num, bit - 1, nd->zero);
    } else {
      found = (1LL << bit) | find(num, bit - 1, nd->one);
    }
  } else {
    if (nd->one && nd->one->num > 0) {
      found = (1LL << bit) | find(num, bit - 1, nd->one);
    } else {
      found = find(num, bit - 1, nd->zero);
    }
  }
  return found;
}
void remove(long long num, int bit, node *nd) {
  if (bit == -1) return;
  if (num & (1LL << bit)) {
    remove(num, bit - 1, nd->one);
    nd->one->num--;
  } else {
    remove(num, bit - 1, nd->zero);
    nd->zero->num--;
  }
}
bool isin(long long num, int bit, node *nd) {
  if (bit == -1) return true;
  if (num & (1LL << bit)) {
    if (nd->one && nd->one->num > 0) return isin(num, bit - 1, nd->one);
  } else {
    if (nd->zero && nd->zero->num > 0) return isin(num, bit - 1, nd->zero);
  }
  return false;
}
int main() {
  int N;
  cin >> N;
  vector<long long> nums(N, 0);
  long long toDeleteXor = 0;
  for (int i = 0; i < (N); ++i) {
    cin >> nums[i];
    toDeleteXor ^= nums[i];
  }
  vector<long long> xors(N + 1, 0);
  for (int i = nums.size() - 1; i >= (0); --i) {
    xors[i] = xors[i + 1] ^ nums[i];
  }
  int hibit = 0;
  for (int i = 0; i < (xors.size()); ++i) {
    for (int j = 0; j < (60); ++j) {
      if (xors[i] & (1LL << j)) hibit = max(hibit, j);
    }
  }
  node *nd = build(hibit, xors);
  long long maxMatch = 0, currXor = 0;
  for (int i = 0; i < (N + 1); ++i) {
    long long match = find(currXor, hibit, nd);
    maxMatch = max(maxMatch, currXor ^ match);
    if (i != N) {
      toDeleteXor ^= nums[i];
      if (toDeleteXor != 0) {
        remove(toDeleteXor, hibit, nd);
      }
      currXor ^= nums[i];
    }
  }
  cout << maxMatch << endl;
  return 0;
}
