#include <bits/stdc++.h>
using namespace std;
long long totSeg(long long, long long, vector<long long>&,
                 vector<vector<long long>>&, vector<vector<long long>>&);
long long Sum(long long i, long long s, vector<long long>& A,
              vector<vector<long long>>& V, vector<vector<long long>>& S) {
  if (S[i][s] == -1) {
    long long j;
    S[i][s] = 0;
    for (j = 0; j != i + 1; j++)
      S[i][s] = (S[i][s] + totSeg(j, s, A, V, S)) % (long long)(998244353);
  }
  return S[i][s];
}
long long totSeg(long long i, long long s, vector<long long>& A,
                 vector<vector<long long>>& V, vector<vector<long long>>& S) {
  if (i < 0 || s < 0)
    return 0;
  else if (s == A[i])
    return i + 1;
  if (V[i][s] == -1) {
    long long j;
    V[i][s] = 0;
    for (j = 0; j != i; j++)
      V[i][s] =
          (V[i][s] + totSeg(j, s - A[i], A, V, S)) % (long long)(998244353);
  }
  return V[i][s];
}
int main() {
  long long n, s;
  cin >> n >> s;
  vector<long long> A(n);
  long long i;
  for (i = 0; i != n; i++) cin >> A[i];
  vector<vector<long long>> V(n, vector<long long>(s + 1, -1));
  vector<vector<long long>> S(n, vector<long long>(s + 1, -1));
  long long m = 0;
  for (i = 0; i != n; i++)
    m = (m + (totSeg(i, s, A, V, S) * (n - i)) % (long long)(998244353)) %
        (long long)(998244353);
  cout << m;
  return 0;
}
