N,S = map(int,input().split())
A = list(map(int,input().split()))
dp = [[[0 for i in range(S+1)] for i in range(N+1)] for k in range(N+1)]
for i in range(1,N+1):
    for j in range(i):
        dp[i][j][0] = 1
B = [0]
for i in range(1,N+1):
    for j in range(i,N+1):
        n = len(B)
        for k in range(S+1):
            dp[i][j][k] += dp[i][j-1][k]
            if k + A[j-1] <= S:
                dp[i][j][k+A[j-1]] += dp[i][j-1][k]
mod = 998244353
ans = 0
for i in range(1,N+1):
    for j in range(i,N+1):
        ans += dp[i][j][S] % mod
        ans = ans % mod
print(ans)