N = int(input()) A = list(map(int,input().split())) base = [] for a in A: for e in base: a = min(a,a ^ e) if a > 0: base.append(a) dim = len(base) print(pow(2,dim))