#pragma optimize("Ofast") #pragma target("avx2") #include using namespace std; #include using mint=atcoder::static_modint<998244353>; #define endl '\n' using lint=long long; #define all(n) (n).begin(),(n).end() 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); s[0].emplace_back(0); for(int i=0;idp={1}; for(int i=0;ig; int to=0; auto get=[&](const vector&x,int i){ return lower_bound(all(x),i)-x.begin(); }; for(int j=0;jdp2(s[i+1].size()); for(auto j=g._Find_first();j<1024;j=g._Find_next(j)){ dp2[j/32]+=dp[j%32]; if(i+1==n)ans+=dp[j%32]; } swap(dp,dp2); } cout<