#include using namespace std; const long long MOD = 9982444353; int main(){ int N; cin >> N; vector A(N); for (int i = 0; i < N; i++){ cin >> A[i]; } sort(A.begin(), A.end()); int S = 0; for (int i = 0; i < N - 1; i++){ if (A[i] != A[i + 1]){ S |= 1 << (31 - __builtin_clz(A[i] ^ A[i + 1])); } } cout << (1 << __builtin_popcount(S)) % MOD << endl; }