#pragma optimize("Ofast") #pragma target("avx2") #include using namespace std; #include using mint=atcoder::static_modint<998244353>; #define endl '\n' int main(){ cin.tie(0)->sync_with_stdio(0); int n; cin>>n; vectora(n); for(int i=0;i>a[i]; vector>ss(n+1); vector>s(n+1); vector>dp(n+1); ss[0].emplace(0); for(int i=0;i>(); mint ans=0; dp[0][0]=1; for(int i=0;iused; for(auto e:s[i]){ if(used.count(d*(1LL<<31)+(e|a[i])))continue; if((d|e)==d){ dp[i+1][e|a[i]]+=c; used.emplace(d*(1LL<<31)+(e|a[i])); } } } } for(auto [e,c]:dp[n])ans+=c; cout<