#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
/*-------------------------------------------------*/
const int MAX = 60;
struct BinaryMatrix {
  int m, n;

  BinaryMatrix(int m, int n = MAX, bool def = false) : m(m), n(n), dat(m, bitset<MAX>(0)) {
    if (def) {
      REP(i, m) REP(j, n) dat[i][j] = 1;
    }
  }

  BinaryMatrix pow(long long exponent) {
    BinaryMatrix tmp = *this, res(n, n);
    REP(i, n) res[i][i] = 1;
    while (exponent > 0) {
      if (exponent & 1) res *= tmp;
      tmp *= tmp;
      exponent >>= 1;
    }
    return res;
  }

  inline const bitset<MAX> &operator[](const int idx) const { return dat[idx]; }
  inline bitset<MAX> &operator[](const int idx) { return dat[idx]; }

  BinaryMatrix &operator=(const BinaryMatrix &rhs) {
    m = rhs.m;
    n = rhs.n;
    dat.clear();
    dat.resize(m);
    REP(i, m) dat[i] = rhs[i];
    return *this;
  }

  BinaryMatrix &operator+=(const BinaryMatrix &rhs) {
    REP(i, m) dat[i] ^= rhs[i];
    return *this;
  }

  BinaryMatrix &operator*=(const BinaryMatrix &rhs) {
    int height = m, width = rhs.n;
    BinaryMatrix t_rhs(rhs.n, rhs.m), res(height, width);
    REP(i, rhs.n) REP(j, rhs.m) t_rhs[i][j] = rhs[j][i];
    REP(i, height) REP(j, width) res[i][j] = ((dat[i] & t_rhs[j]).count() & 1);
    *this = res;
    return *this;
  }

  BinaryMatrix operator+(const BinaryMatrix &rhs) const { return BinaryMatrix(*this) += rhs; }

  BinaryMatrix operator*(const BinaryMatrix &rhs) const { return BinaryMatrix(*this) *= rhs; }

private:
  vector<bitset<MAX> > dat;
};

int gauss_jordan(BinaryMatrix &matrix, bool is_extended = false) {
  int rank = 0;
  REP(col, matrix.n) {
    if (is_extended && col == matrix.n - 1) break;
    int pivot = -1;
    FOR(row, rank, matrix.m) {
      if (matrix[row][col]) {
        pivot = row;
        break;
      }
    }
    if (pivot == -1) continue;
    swap(matrix[rank], matrix[pivot]);
    REP(row, matrix.m) {
      if (row != rank && matrix[row][col]) matrix[row] ^= matrix[rank];
    }
    ++rank;
  }
  return rank;
}

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n; cin >> n;
  vector<long long> a(n);
  long long ans = 0;
  REP(i, n) {
    cin >> a[i];
    ans ^= a[i];
  }
  REP(i, n) a[i] &= ~ans;
  BinaryMatrix bm(n);
  REP(i, n) {
    REP(j, 60) if (a[i] >> j & 1) bm[i][MAX - 1 - j] = 1;
  }
  gauss_jordan(bm);
  long long ans2 = 0;
  REP(i, n) {
    long long val = 0;
    REP(j, 60) if (bm[i][j]) val |= 1LL << (MAX - 1 - j);
    ans2 = max(ans2, ans2 ^ val);
  }
  cout << ans + ans2 * 2 << '\n';
}


Measured memory_bytes: 1792