MOD = 998244353 n = int(input()) a = list(map(int, input().split())) a.sort() m = 0 for i in range(n - 1): x = a[i] y = a[i + 1] if x != y: xor = x ^ y k = xor.bit_length() - 1 m += 1 ans = pow(2, m, MOD) print(ans)