#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>s(n+1); vector>dp(n+1); s[0].emplace(0); for(int i=0;i>used; for(auto e:s[i]){ if(used.count(make_pair(d,e|a[i])))continue; if((d|e)==d){ dp[i+1][e|a[i]]+=c; used.emplace(d,e|a[i]); } } } } for(auto [e,c]:dp[n])ans+=c; cout<