n, m = map(int, input().split()) A = list(map(int, input().split())) mod = 998244353 fact = [1] * (m + 1) inv = [1] * (m + 1) finv = [1] * (m + 1) for i in range(2, m + 1): fact[i] = fact[i - 1] * i % mod inv[i] = mod - inv[mod % i] * (mod // i) % mod finv[i] = finv[i - 1] * inv[i] % mod def comb(a, b): return fact[a] * finv[b] * finv[a - b] % mod dp = [0 for _ in range(m + 1)] stones = [0 for _ in range(m + 1)] dp[0] = 1 for i in range(m): if dp[i] > 0: for j in range(n): if i + A[j] > m: continue if stones[i + A[j]] != 0 and stones[i] + 1 > stones[i + A[j]]: continue stones[i + A[j]] = stones[i] + 1 dp[i + A[j]] = comb(m - stones[i + A[j]], i + A[j] - stones[i + A[j]]) ans = 0 for i in range(m + 1): ans += dp[i] ans %= mod print(ans)