N = int(input()) A = list(map(int, input().split())) B = [] for a in A: for b in B: a = min(a, a^b) if a: B.append(a) print(1<