#include using namespace std; #include using mint=atcoder::static_modint<998244353>; int main(){ 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<