
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ls( s) (s&(-s))
#define ll long long
#define inf 0x3f3f3f3f
const ll N = 500030;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =    998244353;
ll n,s;
ll arr[3050];
ll ans=0;
ll dp[3050][3050][3050];
void fn(ll l,ll cur,ll sum)
{if(sum<0||cur>n-1)
  return ;
	if(sum==0)
	{

		ans=(ans+(l+1)*(n-cur))%mod;
	}
	else
	{
		for(ll j=cur+1;j<n;j++)
		{
			if(!dp[l][j][sum-arr[j]])
			{
			  dp[l][j][sum-arr[j]]=1;
			fn(l,j,sum-arr[j]);
		}
		}
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	    cin.tie(NULL);
cin>>n>>s;
for(int i=0;i<n;i++)
cin>>arr[i];
for(int i=0;i<n;i++)
{
	fn(i,i,s-arr[i]);
}
cout<<ans;
}
