#include #include using namespace std; using mint = atcoder::modint998244353; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, m, v; cin >> n >> m; vector dp(m + 1, 1 << 30); vector fact(m + 1), inv(m + 1); fact[0] = 1, dp[0] = 0; for(int i = 1; i <= m; i++)fact[i] = i * fact[i - 1]; inv[m] = 1 / fact[m]; for(int i = m; i >= 1; i--)inv[i - 1] = i * inv[i]; for(int i = 0; i < n; i++){ cin >> v; for(int j = 0; j + v <= m; j++) dp[j + v] = min(dp[j + v], dp[j] + 1); } mint ans; for(int i = 0; i <= m; i++){ if(dp[i] >> 30 & 1)continue; int r = m - dp[i], c = i - dp[i]; ans += fact[r] * inv[r - c] * inv[c]; } cout << ans.val() << endl; }