#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n, m;
int a[maxn];
int main() {
  while (~scanf("%d", &n)) {
    int res = 0, num = 0;
    while (n--) {
      scanf("%d", &m);
      for (int i = num - 1; i >= 0; i--) {
        res = max(res, a[i] ^ m);
        if (a[i] >= m) {
          break;
        }
        num--;
      }
      a[num++] = m;
    }
    printf("%d\n", res);
  }
  return 0;
}
