#include #define rep(i, l, r) for (int i = (l); i < (r); i++) using namespace std; typedef long long ll; ll MOD = 998244353; vector f(1e5 + 1, 1); ll mod_pow(ll x, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } ll C(ll n, ll k) { ll ret = f[n] * mod_pow(f[k], MOD - 2, MOD) % MOD; ret = ret * mod_pow(f[n - k], MOD -2, MOD) % MOD; return ret; } int main() { ll ans = 0; int N, M; cin >> N >> M; rep(i, 0, M) f[i + 1] = f[i] * (i + 1) % MOD; vector A(N); rep(i, 0, N) cin >> A[i]; queue> q; vector b(M + 1, 1e9); //x個選ぶのに最小でb(x)回必要; q.push(make_pair(0, 0)); map, bool> done; while (!q.empty()) { int x = q.front().first, y = q.front().second; //cout << "(" << x << "," << y << ")"; q.pop(); b[y] = min(b[y], x); rep(i, 0, N) { if (y + A[i] <= M && !done[make_pair(x + 1, y + A[i])]) { q.push(make_pair(x + 1, y + A[i])); done[make_pair(x + 1, y + A[i])] = true; } } } rep(i, 0, M + 1) { //cout << i << " " << b[i] << endl; if (b[i] == 1e9) continue; ans += C(M - b[i], i - b[i]); ans %= MOD; } cout << ans << endl; }