#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll p=998244353ll;
ll fun(vector<int> &vec,vector<vector<vector<ll>>> &dp, bool selected,int index,ll sum)
{
	if(sum<0)
		return 0;
	if(sum==0)
	{
		return index+2;
	}

	if(index==0)
	{
		if(vec[index]==sum)
			return 1;
		else
			return  0;
	}

	if(selected)
	{
		if(dp[index][sum][1]!=-1)
		{
			return dp[index][sum][1];
		}
		
		dp[index][sum][1] = fun(vec,dp,true,index-1,sum)+fun(vec,dp,true,index-1,sum-vec[index]);
		dp[index][sum][1]%=p;
		return dp[index][sum][1];
	}
	else
	{
		if(dp[index][sum][0]!=-1)
		{
			return dp[index][sum][0];
		}
		
		dp[index][sum][0] = fun(vec,dp,false,index-1,sum)+(fun(vec,dp,true,index-1,sum-vec[index])*(n-index))%p;
		dp[index][sum][0]%=p;
		return dp[index][sum][0];
	}
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,s;
    cin>>n>>s;
    vector<int> vec(n);
    for(int i=0;i<n;++i)
    {
    	cin>>vec[i];
    }

    vector<vector<vector<ll>>> dp(n,vector<vector<ll>(3000,vector<ll>(2,-1)));
    ll ans=fun(vec,dp,false,n-1,s);
    cout<<ans<<"/n";

}
