MOD = 998244353

N,S = list(map(int,input().split()))
A=list(map(int,input().split()))

dp= [[[0 for i in range(S+1)] for j in range(N+1)] for k in range(N+1)]
for i in range(N+1):
    dp[i][i-1][0] = 1
    
    
def np(L,R,S):
#    print("np",L,R,S)
    if L>R and S!=0:
        return 0
    
    elif dp[L][R][S] >0:
        return dp[L][R][S]
    else:
#        print(1,S - A[R-1]>=0)
        if S - A[R-1]>=0:
#            print(2,(dp[L][R-1][S-A[R-1]] + dp[L][R-1][S]) )
            return (np(L,R-1,S-A[R-1]) + np(L,R-1,S)) 
        else:
#            print(3,dp[L][R-1][S])
            return np(L,R-1,S)
            



ans = 0
for R in range(1,N+1):
    for L in range(1,R+1):
        
#        print("out",(L,R,S))
        k=np(L,R,S)
#        print("end",k)
        ans += k % MOD
print(ans%MOD)
