#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  stack<int> stk;
  int max_xor = 0;
  int i = 0;
  while (i < n) {
    if (stk.empty()) {
      stk.push(a[i++]);
      continue;
    }
    int x = a[i] ^ stk.top();
    if (x > max_xor) {
      max_xor = x;
    }
    if (stk.top() < a[i]) {
      stk.pop();
    } else {
      stk.push(a[i++]);
    }
  }
  cout << max_xor << "\n";
}
