N = int(input()) A = list(map(int,input().split())) cnt = 0 for i in reversed(range(61)): B = [] tp = 1 << i A = sorted(list(set(A))) if A and A[-1] >= tp: cnt += 1 a = A.pop() while A and A[-1] >= tp: x = A.pop() ^ a B.append(A.pop() ^ a) A += B print(pow(2,cnt))