#include <bits/stdc++.h>
using namespace std;
long long mymod(long long a, long long b) {
  if (a % b < 0) {
    return a % b + b;
  }
  return a % b;
}
long long mod_exp(long long a, long long b, long long c) {
  long long res = 1;
  a = a % c;
  while (b > 0) {
    if (b % 2 == 1) {
      res = (res * a) % c;
    }
    b /= 2;
    a = (a * a) % c;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
bool prime[3001];
void SieveOfEratosthenes() {
  memset(prime, true, sizeof(prime));
  prime[1] = false;
  for (int p = 2; p * p <= 3000; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= 3000; i += p) prime[i] = false;
    }
  }
}
long long powe[20];
void power() {
  powe[0] = 1;
  for (long long i = 1; i < 20; i++) {
    powe[i] = (powe[i - 1] * 10) % 998244353;
    if (powe[i] < 0) powe[i] += 998244353;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, second;
  cin >> n >> second;
  long long A[n + 1];
  for (long long i = 1; i < n + 1; i++) {
    cin >> A[i];
  }
  long long dp[n + 1][second + 1];
  for (long long i = 0; i < n + 1; i++)
    for (long long j = 0; j < second + 1; j++) dp[i][j] = 0;
  dp[1][A[1]] = 1;
  for (long long i = 2; i < n + 1; i++) {
    dp[i][A[i]] += i;
    for (long long j = A[i]; j < second + 1; j++) {
      for (long long k = 1; k < i; k++) {
        dp[i][j] += dp[k][j - A[i]];
      }
    }
  }
  long long ans = 0;
  for (long long i = 1; i < n + 1; i++) {
    ans += dp[i][second] * (n - i + 1);
    ans = mymod(ans, 998244353);
  }
  cout << ans << "\n";
  return 0;
}
