N, S = map(int,input().split())
A = [0] + list(map(int, input().split()))
p = 998244353

dp = [[[0 for i in range(S+1)] for j in range(N+1)] for k in range(N+1)]

for j in range(N+1):
  for k in range(j+1):
    dp[k][j][0] = 1
ans = 0
for i in range(1,S+1):
  for j in range(1,N+1):
    for k in range(j+1):
      offset = dp[k][j-1][i-A[j]] if i-A[j]>-1 else 0
      dp[k][j][i] = (dp[k][j-1][i]+offset)%p
      if i == S:
        ans += dp[k][j][i]
        ans %= p
print(ans)