Prefix & Suffix Maximization

Limits 1s, 256 MB

You are given an array aa of nn integers. Now, let’s define two variables PP and SS. Where PP is the bitwise XOR value of all elements for any non-empty prefix. And SS is the bitwise XOR value of all elements for any non-empty suffix. Now find the maximum value of (P&S)(P \& S). Where &\& denotes the bitwise AND operation.

Note that, the sum of the length of chosen prefix and suffix has to be less than or equal to nn.

Input

The first line of the input contains one integer n (2n106)n \ (2≤n≤10^6) denoting the number of elements of the array.

The next line contains n space-separated integers a1,a2,,an(1ai109)a_1 ​ ,a_2 ​ ,…,a_n ​ (1≤a_i ​≤10^9 ) denoting the elements of the array.

Output

Print the maximum value of (P&S)(P \& S) as described in the statement.

Samples

InputOutput
2
12 12
12
InputOutput
4
2 4 2 4
6