#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
const int N = 100005;
long long s;
long long rec(vector<long long> &v) {
  long long n = (long long)v.size();
  long long dp[n + 1][s + 1];
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= s; j++) dp[i][j] = dp[i - 1][j];
    for (long long j = 0; j <= s; j++) {
      if ((v[i] + j) <= s)
        dp[i][v[i] + j] = (dp[i][v[i] + j] + dp[i - 1][j]) % 998244353;
    }
  }
  return dp[n][s];
}
void solve() {
  long long n;
  cin >> n >> s;
  vector<long long> v(n + 1);
  for (long long i = 1; i <= n; i++) cin >> v[i];
  long long ans = 0;
  for (long long i = 0; i <= n - 1; i++) {
    vector<long long> temp = vector<long long>(v.begin() + i, v.end());
    ans = (ans + rec(temp)) % 998244353;
  }
  long long dp[n + 1][s + 1];
  memset(dp, 0, sizeof(dp));
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j <= s; j++) dp[i][j] = dp[i - 1][j];
    if (v[i] <= s) dp[i][v[i]] = (dp[i][v[i]] + i) % 998244353;
    for (long long j = 0; j <= s; j++) {
      if ((v[i] + j) <= s)
        dp[i][v[i] + j] = (dp[i][v[i] + j] + dp[i - 1][j]) % 998244353;
    }
  }
  long long tot = 0;
  for (long long i = 1; i <= n; i++) {
    tot = (tot + dp[i][s]) % 998244353;
  }
  cout << tot << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    solve();
  }
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
