#include #include using namespace std; using namespace atcoder; using ll = long long; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < n; i++) #define rrep(i,n) for (int i = n-1; i >= 0; i--) #define rep2(i,a,b) for (int i = a; i < b; i++) #define rrep2(i,a,b) for (int i = a-1; i >= b; i--) #define rep3(i,a,b,c) for (int i = a; i < b; i+=c) #define rrep3(i,a,b,c) for (int i = a-1; i >= b; i-=c) #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} const int MOD=998244353; int n,A[200010]; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cin>>n; rep(i,n)cin>>A[i]; ll ans=1; rep(i,30){ setse1,se0; vectorv; rep(j,n){ v.push_back(A[j]>>(i+1)); if(A[j]>>i&1)se1.insert(A[j]>>(i+1)); else se0.insert(A[j]>>(i+1)); } bool ok=false; if(se1.size()&&se0.size()){ for(auto x:v){ if(se1.count(x)&&se0.count(x)){ ok=true; break; } } } if(ok){ ans*=2; ans%=MOD; } } cout<