def main(): from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum from heapq import heapify, heappop, heappush from bisect import bisect_left, bisect_right from copy import deepcopy import copy import random from collections import deque,Counter,defaultdict from itertools import permutations,combinations from decimal import Decimal,ROUND_HALF_UP #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP) from functools import lru_cache, reduce #@lru_cache(maxsize=None) from operator import add,sub,mul,xor,and_,or_,itemgetter INF = 10**18 mod1 = 10**9+7 mod2 = 998244353 #DecimalならPython ''' 最終的な数だから、あり得る配置を列挙できれば良い 使うコインの数は少ないほどよい dpでやる dp[何枚か] = 使う数 ''' #p = のところを変更すること。 #limitationも必要なら変更 def nCr(n, r, p): if (r < 0) or (n < r): return 0 r = min(r, n - r) return fact[n] * factinv[r] * factinv[n-r] % p p = mod2 limitation = 10 ** 6 # N は必要分だけ用意する fact = [1, 1] # fact[n] = (n! mod p) factinv = [1, 1] # factinv[n] = ((n!)^(-1) mod p) inv = [0, 1] # factinv 計算用 for i in range(2, limitation + 1): fact.append((fact[-1] * i) % p) inv.append((-inv[p % i] * (p // i)) % p) factinv.append((factinv[-1] * inv[-1]) % p) N,M = map(int, input().split()) A = list(map(int, input().split())) dp = [INF]*(M+1) dp[0] = 0 for i in range(N): for j in range(M): if dp[j] >= 0 and j+A[i] <= M: dp[j+A[i]] = min(dp[j+A[i]],dp[j]+1) ans = 0 for i in range(1,M+1): if dp[i] >= 1: ans += nCr(M-dp[i],i-dp[i],mod2) ans %= mod2 print(ans+1) if __name__ == '__main__': main()