#include using namespace std; #define rep(i,n) for(int i=0; i<(n); i++) #define INF ((1LL<<62)-(1LL<<31)) #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() typedef long long ll; typedef pair pl; const ll mod=998244353; vector tot; ll modpow(ll n,ll r) { ll num=1; while(r) { if(r&1) num=num*n%mod; n=n*n%mod; r/=2; } return num; } ll comb(ll n,ll r1,ll r2) { return tot[n]*modpow((tot[r1]*tot[r2])%mod,mod-2)%mod; } int main() { ll n,m; cin >> n >> m; vector a(n); rep(i,n) cin >> a[i]; vector> dp(n+1,vector (m+1,INF)); dp[0][0]=0; rep(i,n) for(int j=0;j<=m;j++) { if(dp[i][j]!=INF) dp[i+1][j]=min(dp[i+1][j],dp[i][j]); if(j-a[i]>=0) { if(dp[i][j-a[i]]!=INF) { dp[i][j]=min(dp[i][j-a[i]]+1,dp[i][j]); } dp[i+1][j]=min(dp[i+1][j],dp[i][j-a[i]]+1); } } tot.resize(m+1); tot[0]=tot[1]=1; for(ll i=2;i<=m;i++) tot[i]=(i*tot[i-1])%mod; ll ans=0; rep(i,m+1) if(m>=dp[n][i]&&i>=dp[n][i]) { ans+=comb(m-dp[n][i],i-dp[n][i],m-i); ans%=mod; } cout << ans << endl; }