""" https://yukicoder.me/problems/no/184 基底 """ def xor_base(lis): base = [] for na in lis: for e in base: na = min(na , e^na) if na > 0: base.append(na) for i in range(len(base)-1,-1,-1): for j in range(i+1,len(base)): if base[i] ^ base[j] < base[i]: base[i] ^= base[j] return base def construct_able(x,base): ret = [] for i,b in enumerate(base): nbit = 2**(b.bit_length()-1) if nbit & x > 0: x ^= b ret.append(i) if x == 0: return True,ret else: return False,None from collections import deque N = int(input()) A = list(map(int,input().split())) base = xor_base(A) print (2**len(base))