N = int(input()) A = list(map(int, input().split())) U = 60 mat = [[0] * (U+1) for _ in range(N)] for i, a in enumerate(A): for j in range(U+1): mat[i][j] = (a >> j) & 1 ans = 0 check = [0] * N for j in range(U+1): start = -1 for i in range(N): if check[i]: continue if mat[i][j]: check[i] = 1 ans += 1 start = i break if start == -1: continue for i in range(N): if check[i]: continue if mat[i][j]: for k in range(U+1): mat[i][k] ^= mat[start][k] print(1 << ans)