#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') positive = 0;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline char RC() {
  char c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
  return c;
}
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline long long lcm(long long a, long long b, long long MOD) {
  return a / gcd(a, b) * b % MOD;
}
inline long long Sub(long long x, long long y, long long mod) {
  long long res = x - y;
  while (res < 0) res += mod;
  return res;
}
inline long long Add(long long x, long long y, long long mod) {
  long long res = x + y;
  while (res >= mod) res -= mod;
  return res;
}
inline long long POW_MOD(long long x, long long y, long long mod) {
  long long ret = 1;
  while (y > 0) {
    if (y & 1) ret = ret * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ret;
}
const int N = 2000005 + 100;
const int M = 400000 + 100;
const long long INF = 9e18;
const int inf = 0x7fffffff;
const long long MOD = 1000000007;
const double PI = acos(-1.0);
const double G = 9.8;
const double eps = 1e-3;
int n;
long long a[N];
long long xorSum;
struct Node {
  Node *next[2];
  Node() { next[0] = next[1] = NULL; }
};
class Trie {
 public:
  Trie() { root = new Node(); }
  ~Trie() {}
  void trans(long long x, string &res) {
    while (x) {
      res += x % 2 + '0';
      x /= 2;
    }
    int dis = 40 - (int)res.size();
    for (int i = 0; i < dis; ++i) res += '0';
    reverse(res.begin(), res.end());
  }
  void insert(long long val) {
    string res = "";
    trans(val, res);
    Node *cur = root;
    for (auto x : res) {
      int v = x - '0';
      if (cur->next[v]) {
        cur = cur->next[v];
      } else {
        cur->next[v] = new Node();
        cur = cur->next[v];
      }
    }
  }
  long long run(long long x) {
    string res = "";
    trans(x, res);
    Node *cur = root;
    long long rlt = 0;
    for (int i = 0; i < 40; ++i) {
      int v = 1 - (res[i] - '0');
      if (cur->next[v]) {
        cur = cur->next[v];
        rlt ^= (1LL << (40 - i - 1));
      } else {
        cur = cur->next[1 - v];
      }
    }
    return max(rlt, x);
  }

 private:
  Node *root;
};
int main() {
  cin >> n;
  long long ans = 0;
  xorSum = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    xorSum ^= a[i];
  }
  Trie *trie = new Trie();
  long long leftXorSum = 0;
  for (int i = 0; i <= n; ++i) {
    leftXorSum ^= a[i];
    long long rightXorSum = xorSum ^ leftXorSum;
    if (i > 0) {
      trie->insert(leftXorSum);
      ans = max(ans, trie->run(rightXorSum));
    } else {
      ans = max(ans, rightXorSum);
    }
  }
  cout << ans << endl;
  return 0;
}
