n = int(input()) a = list(map(int,input().split())) b = [] for i in a: for j in b: i = min(i, i^j) if i > 0: b.append(i) print(pow(2, len(b)))