#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int Max = 2210, Maxp = 5605, MOD = 998244353;
int n, p, c[Max];
ll dp[Max][Maxp];
int main(){
freopen("subsubset.inp", "r", stdin);
freopen("subsubset.out", "w", stdout);
cin >> n >> p;
for (int i=1; i<=n; i++) cin >> c[i];
dp[0][0] = 1;
ll ans = 0;
for (int i=1; i<=n; i++) for (int j=0; j<=p; j++) {
dp[i][j] = (dp[i-1][j]+dp[i-1][j-c[i]])%MOD;
ans = (ans+dp[i][j])%MOD;
}
cout << ans << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnR5cGVkZWYgbG9uZyBsb25nIGxsOwpjb25zdCBpbnQgTWF4ID0gMjIxMCwgTWF4cCA9IDU2MDUsIE1PRCA9IDk5ODI0NDM1MzsKaW50IG4sIHAsIGNbTWF4XTsKbGwgZHBbTWF4XVtNYXhwXTsKCmludCBtYWluKCl7CglmcmVvcGVuKCJzdWJzdWJzZXQuaW5wIiwgInIiLCBzdGRpbik7CglmcmVvcGVuKCJzdWJzdWJzZXQub3V0IiwgInciLCBzdGRvdXQpOwoJY2luID4+IG4gPj4gcDsKCWZvciAoaW50IGk9MTsgaTw9bjsgaSsrKSBjaW4gPj4gY1tpXTsKCWRwWzBdWzBdID0gMTsKCWxsIGFucyA9IDA7Cglmb3IgKGludCBpPTE7IGk8PW47IGkrKykgZm9yIChpbnQgaj0wOyBqPD1wOyBqKyspIHsKCQlkcFtpXVtqXSA9IChkcFtpLTFdW2pdK2RwW2ktMV1bai1jW2ldXSklTU9EOwoJCWFucyA9IChhbnMrZHBbaV1bal0pJU1PRDsKCX0KCgljb3V0IDw8IGFucyA8PCBlbmRsOwoJcmV0dXJuIDA7Cn0=