#include #include using namespace std; using namespace atcoder; const int INF = 1073741823; using mint = modint998244353; vector fac = vector(); vector faci = vector(); void init_mod(int n){ assert(0 < n); fac.push_back(1); for(int i = 1; i <= n; i++) fac.push_back(fac.back() * i); faci.push_back(fac.back().inv()); for(int i = n; i > 0; i--) faci.push_back(faci.back() * i); reverse(faci.begin(), faci.end()); } mint binom(int n,int r){ if(n < 0 || r < 0 || n < r) return 0; return fac[n] * faci[r] * faci[n - r]; } int main(){ int N, M; cin >> N >> M; vectorA(N); for(int i = 0; i < N; i++) cin >> A[i]; vectordp(M + 1, INF); dp[0] = 0; for(int i = 0; i < M; i++){ for(int j = 0; j < N; j++){ if(i + A[j] <= M) dp[i + A[j]] = min(dp[i + A[j]], dp[i] + 1); } } init_mod(M); mint ans = 0; for(int K = 0; K <= M; K++){ if(dp[K] == INF) continue; ans += binom(M - dp[K], K - dp[K]); } cout << ans.val() << endl; return 0; }