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[-1] >= tp: cnt += 1 a = A.pop() while A and A[-1] >= tp: x = A.pop() ^ a if x != 0: B.append(A.pop() ^ a) A += B print(pow(2,cnt))