n = int(input()) a = list(map(int, input().split())) ret = 0 for i in range(n): if a[i]: ret += 1 x = 0 while (2**(x+1)) <= a[i]: x += 1 for y in range(i+1, n, 1): if a[y] & (2 ** x): a[y] ^= a[i] print(2**ret)