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