n,s=map(int,input().split())
lists=list(map(int,input().split()))
mod=998244353
dp=[[0 for i in range(s+1)] for j in range(n+1)]
#dp[i][j]:r<=iかつ計算結果がjになるようなものの総数
for i in range(n+1):
    dp[i][0]=1
for i in range(1,n+1):
    for j in range(1,s+1):
        if j>=lists[i-1]:
            dp[i][j]=(dp[i-1][j]+dp[i-1][j-lists[i-1]])
            dp[i][j]=dp[i][j]%mod
        else:
            dp[i][j]=dp[i-1][j]
            dp[i][j]=dp[i][j]%mod
print(dp[n][s]%mod)
    
        
    
    
