#include #include #include using namespace std; 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 answer = 1; for (int i = 0; i < 30; i++) { bool flag = false; for (int j = 0; j < N - 1; j++) { if (((A[j] >> i) & 1) != ((A[j + 1] >> i) & 1) && (A[j] >> (i + 1)) == (A[j + 1] >> (i + 1))) { flag = true; } } if (flag) { answer *= 2; } } cout << answer % 998244353 << endl; return 0; }