class xor_base(): def __init__(self): self.K = 60 self._list = [0] * self.K self.cnt = 0 def min_all(self, x): for i in range(self.K - 1, -1, -1): if (x >> i) & 1: x ^= self._list[i] return x def add(self, x): x = self.min_all(x) if x == 0: return for i in range(self.K - 1, -1, -1): if (x >> i) & 1: for j in range(self.K): if (self._list[j] >> i) & 1: self._list[j] ^= x self._list[i] = x self.cnt += 1 return def get(self, x): now = 0 for i in range(self.K): if (x >> i) & 1: now ^= self._list[i] return now def __len__(self): return self.cnt def __str__(self): return f"{self._list}, len = {self.cnt}" N = int(input()) A = list(map(int, input().split())) B = xor_base() for a in A: B.add(a) print(2**len(B))