class XOR_Vector_Space: def __init__(self): self.S=[] def __contains__(self,x): for v in self.S: if x&v&(-v): x^=v if x==0: return True return False def __add__(self,other): W=XOR_Vector_Space() W.S=self.S[:] W.add_vector(*other.S) return W def add_vector(self,*T): for x in T: for v in self.S: if x&v&(-v): x^=v if x==0: break if x: self.S.append(x) def dim(self): return len(self.S) def reduction(self): S=self.S for i in range(len(S)): vb=S[i]&(-S[i]) for j in range(len(S)): if i==j: continue if S[j]&vb: S[j]^=S[i] self.S=[s for s in S if s] def __le__(self,other): for u in self.S: if not u in other: return False return True def __ge__(self,other): return other<=self def __eq__(self,other): return (self<=other) and (other<=self) #================================================ N=int(input()) A=list(map(int,input().split())) V=XOR_Vector_Space() V.add_vector(*A) print(pow(2,V.dim()))