#include <bits/stdc++.h>
#define BIT(n) (1LL << (n))
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPB(i, n) for (int i = 0; i < BIT(n); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORA(i, n) for (auto &&i : n)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define DEBUG(x) cerr << #x << ": " << x << "\n"
#define PRINTALL(V)                                                            \
  for (auto v : (V)) {                                                         \
    cerr << v << " ";                                                          \
  }                                                                            \
  cerr << "\n";
#define ALL(v) v.begin(), v.end()
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define epb emplace_back
#define int long long
#define pint pair< int, int >
using namespace std;
template < class T > bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template < class T > bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template < class T > using vec = std::vector< T >;
template < class T > void print(const T &x) { cout << x << "\n"; }
const int MOD = 1000000007, INF = 1061109567, INF2 = INF * INF;
const double EPS = 1e-10, PI = acos(-1.0);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int a[100100];
int mat[100100][60];
int absum[60];
int matVal[60];
bool flg[60];
//行列A
int calcRank(int M, int N, int a[100100][60]) {
  int cnt = 0;
  REP(i, N) {
    int pivot = cnt;
    FOR(j, cnt, N) {
      if (abs(a[j][i]) > abs(a[pivot][i]))
        pivot = j;
    }
    swap(a[cnt], a[pivot]);
    // REP(j, N) { PRINTALL(a[j]); }
    if (abs(a[cnt][i]) < EPS) {
      continue;
    }
    REP(j, M) {
      if (cnt != j) {
        FOR(k, i + 1, N) a[j][k] -= a[j][i] * a[cnt][k];
      }
      //   REP(j, N) { PRINTALL(a[j]); }
      //   cerr << "\n";
    }
    REP(j, M) a[j][i] = (j != cnt) ? 0 : 1;
    cnt++;
  }
  return cnt;
}
int calcRankXor(int M, int N, int a[100100][60]) {
  int cnt = 0;
  REP(i, N) {

    int pivot = cnt;
    FOR(j, cnt, N) {
      if (a[j][i] == 1) {
        pivot = j;
        break;
      }
    }
    swap(a[cnt], a[pivot]);

    if (a[cnt][i] == 0)
      continue;

    REP(j, M) {
      if (cnt != j) {
        FOR(k, i + 1, N) a[j][k] = (a[j][k] + a[j][i] * a[cnt][k]) % 2;
      }
    }
    REP(j, M) a[j][i] = (j != cnt) ? 0 : 1;
    cnt++;
  }
  return cnt;
}
signed main() {
  cin.tie(0), ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int N;
  cin >> N;

  REP(i, N) { cin >> a[i]; }
  REP(i, N) {
    REP(j, 60) {
      if (a[i] & BIT(j)) {
        absum[j]++;
      }
    }
  }

  int cnt = 0;
  REPR(i, 59) {
    if (absum[i] % 2 == 0 && absum[i] > 0) {
      matVal[cnt] = BIT(i);
      REP(j, N) { mat[j][cnt] = (a[j] & BIT(i)) ? 1 : 0; }
      cnt++;
    }
  }

  int res = calcRankXor(N, cnt, mat);
  /*  REP(i, res + 2) {
      PRINTALL(mat[i]);
      cout << "\n";
    }*/
  res = N;
  int ans = 0;
  vec< int > b(res, 0);
  REP(j, res) {
    REP(i, cnt) { b[j] += (mat[j][i]) ? matVal[i] : 0; }
  }

  REP(i, res) chmax(ans, ans ^ b[i]);
  ans *= 2;

  REP(i, 60) {
    if (absum[i] % 2 == 1) {
      ans += BIT(i);
    }
  }

  print(ans);
}

Measured memory_bytes: 48768