#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
bool cmin(A &a, const B &b) {
  return a > b ? (a = b, true) : false;
}
template <typename A, typename B>
bool cmax(A &a, const B &b) {
  return a < b ? (a = b, true) : false;
}
const double PI = acos(-1);
const double EPS = 1e-9;
long long inf = sizeof(long long) == sizeof(long long) ? 2e18 : 1e9 + 10;
long long dx[] = {-1, 0, 1, 0};
long long dy[] = {0, 1, 0, -1};
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> in(n);
  for (long long i = 0; i < n; i++) cin >> in[i];
  vector<long long> dp(6010);
  dp[0] = 1;
  long long out = 0, MOD = 998244353;
  for (long long i = 0; i < n; i++) {
    for (long long j = 6009; j >= 0; j--)
      if (dp[j]) (dp[j + in[i]] += dp[j] * (j ? 1 : i + 1) % MOD) %= MOD;
    (out += dp[m] * (n - i) % MOD) %= MOD;
    dp[m] = 0;
  }
  cout << out << endl;
}
