N=int(input()) A=sorted(map(int,input().split())) C=[1]*30 for i in range(N-1): v=(A[i]^A[i+1]).bit_length() C[v-1]=2 ANS=1 for i in range(30): ANS*=C[i] print(ANS%998244353)