#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000000000")
using namespace std;
long long int get_bit(long long int a, long long int i) {
  return (a & (1LL << i));
}
int main() {
  long long int n;
  cin >> n;
  vector<long long int> op(n);
  vector<long long int> good(n);
  long long int now = 0;
  for (long long int i = 0; i < n; i++)
    cin >> op[i], now ^= op[i], good[i] = now;
  long long int ans = 0;
  set<long long int> q;
  q.insert(0);
  now = 0;
  for (long long int i = n; i >= 0; i--) {
    if (i != n) now ^= op[i], q.insert(now);
    long long int f = (i == 0 ? 0 : good[i - 1]);
    long long int best = 0;
    set<long long int>::iterator it;
    for (long long int j = 40; j >= 0; j--) {
      long long int temp = best;
      if (!get_bit(f, j)) temp = (temp | (1LL << j));
      it = q.lower_bound(temp);
      if (it == q.end()) continue;
      if (temp > best && (*it - temp) > (1LL << j)) continue;
      if (get_bit(*it, j)) best = (best | (1LL << j));
    }
    ans = max(ans, (f ^ best));
  }
  cout << ans;
}
