#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5e5 + 5;
const int N2 = 1e5 + 5;
long long a[N2], ans;
struct Trie {
  int go[40];
  bool en;
} trie[N];
void dfs(int v, long long x, long long suf) {
  if (trie[v].en) ans = max(ans, suf ^ x);
  bool kettik = 0;
  int mx = -1, mx_bit = -1;
  for (int j = 39; j >= 0; --j) {
    if (trie[v].go[j]) {
      if (!(suf & (1ll << j))) {
        dfs(trie[v].go[j], x ^ (1ll << j), suf);
        kettik = 1;
        break;
      }
      mx = trie[v].go[j];
      mx_bit = j;
    }
  }
  if (!kettik && mx != -1) {
    dfs(mx, x ^ (1ll << mx_bit), suf);
  }
}
void solve() {
  int n;
  cin >> n;
  long long suf = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    suf ^= a[i];
  }
  long long pref = 0;
  int node_num = 0;
  for (int i = 1; i <= n; ++i) {
    pref ^= a[i];
    ans = max(ans, pref);
    int cur = 0;
    for (int j = 39; j >= 0; --j) {
      if ((pref >> j) & 1) {
        if (!trie[cur].go[j]) {
          ++node_num;
          trie[cur].go[j] = node_num;
        }
        cur = trie[cur].go[j];
      }
    }
    trie[cur].en = 1;
    suf ^= a[i];
    ans = max(ans, suf);
    dfs(0, 0ll, suf);
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tt = 1;
  while (tt--) {
    solve();
  }
  return 0;
}
