n = int(input()) a = list(map(int, input().split())) # XOR基底掃き出し base = [0] for v in a: for e in base: v = min(v, v ^ e) if v > 0: base.append(v) print(pow(2, len(base) - 1))