MOD = 998244353 class Node: __slots__ = ['left', 'right'] def __init__(self): self.left = None self.right = None n = int(input()) A = list(map(int, input().split())) root = Node() m = 0 for num in A: node = root for bit in reversed(range(30)): # Process bits from 29 down to 0 current_bit = (num >> bit) & 1 if current_bit == 0: if not node.left: node.left = Node() # Check if the right child exists now if node.right: m += 1 child = node.left else: if not node.right: node.right = Node() # Check if the left child exists now if node.left: m += 1 child = node.right node = child print(pow(2, m, MOD))