from operator import xor from collections import deque from functools import reduce from sys import stdin def pair(lst): def func(a, b): n = len(a) if n == 2: ret.append(reduce(xor, b + [a[0] + a[1]])) return a0 = a.popleft() for _ in [0] * (n - 1): ai = a.popleft() arg2 = b + [a0 + ai] func(a.copy(), arg2) a.append(ai) lst = deque(lst) ret = [] func(lst, []) return ret def main(): input = lambda: stdin.readline() N = int(input()) A = list(map(int, input().split())) ans = max(pair(A)) print(ans) main()