#include <bits/stdc++.h>   #pragma GCC target( avx,avx2,fma )   #pragma GCC optimization( O8 )   #pragma GCC optimization( unroll-loops )   using namespace std;   const long long int N = 4e6 + 20, mod = 1e9 + 7, inf = 1e9, dlt = 12250,                       maxm = 2e6;   int poww(long long a, int k) {     if (!k) return 1;     if (k == 1) return a;     long long r = poww(a, k / 2);     return (((r * r) % mod) * poww(a, k & 1)) % mod;   }   int trie[N][3], cnt;   long long a[N / 10];   void build(string s) {     int p = 0;     string t =   ;     for (char ch : s) {       int u = ch -  0 ;       t += ch;       if (!trie[p][u]) {         cnt++;         trie[p][u] = cnt;       }       p = trie[p][u];     }   }   long long que(long long x) {     int p = 0, h = 0;     long long y = 0;     for (int i = 0; i < 40; i++) {       if (!trie[p][0] && !trie[p][1]) return y;       bool f = (!(x & (1ll << (39 - i))));       if (!trie[p][0] || (trie[p][1] && f)) {         if (f) y += (1ll << (39 - i));         p = trie[p][1];         continue;       }       if (!f) y += (1ll << (39 - i));       p = trie[p][0];     }     return y;   }   int main() {     ios ::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n;     long long x = 0;     cin >> n;     for (int i = 0; i < n; i++) {       cin >> a[i];       x ^= a[i];     }     long long ans = x;     string st =   ;     for (int i = 0; i < 40; i++) st +=  0 ;     build(st);     long long y = 0;     for (int i = 0; i < n; i++) {       x ^= a[i];       y ^= a[i];       string s =   ;       for (int j = 0; j < 40; j++) {         if (y & (1ll << j))           s =  1  + s;         else           s =  0  + s;       }       build(s);       ans = max(que(x), ans);     }     cout << ans;     return 0;   }   