n = int(input()) a = list(map(int, input().split())) s = set() for i in range(30): b = [] for v in a: if v&2**i: b.append(1) else: b.append(0) s.add(tuple(b)) print(pow(2, len(s)-1, 998244353))