#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(d