#include <bits/stdc++.h>
using namespace std;
const long long N = 10002200;
int siz, trie[N][3];
long long p2[200], n, a[200000], ans;
bool en[N];
void add(string s) {
  long long now = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (trie[now][s[i] - '0'] == 0) trie[now][s[i] - '0'] = ++siz;
    now = trie[now][s[i] - '0'];
  }
  en[now] = 1;
}
long long find(string s) {
  long long now = 0, anns = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (trie[now][!(s[i] - '0')]) {
      anns += p2[s.size() - i - 1];
      now = trie[now][!(s[i] - '0')];
    } else
      now = trie[now][(s[i] - '0')];
  }
  return anns;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  p2[0] = 1;
  for (long long i = 1; i <= 100; i++) p2[i] = p2[i - 1] * 2;
  cin >> n;
  long long now = 0;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    now ^= a[i];
    string s;
    long long x = now;
    while (x) {
      s += (x % 2) + '0';
      x /= 2;
    }
    for (long long j = s.size(); j < 100; j++) s += '0';
    reverse(s.begin(), s.end());
    add(s);
  }
  now = 0;
  for (long long i = n; i >= 1; i--) {
    now ^= a[i];
    string s;
    long long x = now;
    while (x) {
      s += (x % 2) + '0';
      x /= 2;
    }
    for (long long j = s.size(); j < 100; j++) s += '0';
    reverse(s.begin(), s.end());
    ans = max((long long)ans, find(s));
  }
  ans = max(ans, max(a[1], a[n]));
  cout << ans;
}
