#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
int main() {
    unsigned int n; unsigned int br = 1;
    cin >> n; cin.ignore();
    string s;
    getline(cin, s);
    int max = -1;
    istringstream iss(s);
    vector<int> niz1(n);
    int poz = -1;
    for (int i = 0; i < n; i++) {
        iss >> niz1[i];
        if (niz1[i] > max)
        {
            max = niz1[i];
            poz = i;
        }
    }
    int max1 = -1;  
    string s1;
    getline(cin, s1);
    istringstream iss1(s1);
    vector<int> niz2(n);
    vector<int> xors(n); int zbx = 0;
    for (int i = 0; i < n; i++) {
        iss1 >> niz2[i];
    }
    for (int i = 0; i < n; i++)
    {
        max = 0;
        for (int j = i; j < n; j++)
        {
            if (niz1[j] > max)
            {
                max = niz1[j];
            }
        }
        while (max > 1)
        {
            max = max / 2;
            br *= 2;
        }
        for (int j = i; j < n; j++)
        {
            if (zbx + niz1[j] < (br * 2) - (br / 2))
            {
                zbx = zbx ^ niz1[j];
            }
            else
                break;
        }
        if (zbx > max1)
        {
            max1 = zbx;
        }
        zbx = 0;
        br = 2;
    }
    cout << (int)max1 << endl;
    return 0;
}