#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  while (long long r = a % b) a = b, b = r;
  return b;
}
class mod {
 public:
  long long val;
  mod(long long v) { val = v % 998244353; }
  mod() { val = 0; }
  void operator-=(const mod &v) {
    val -= v.val;
    if (val < 0) val += 998244353;
  }
  void operator+=(const mod &v) {
    if (val + v.val >= 998244353) val -= 998244353;
    val += v.val;
  }
  void operator+=(long long &v) {
    if (val + v >= 998244353) val -= 998244353;
    val += v;
  }
  void operator*=(const mod &v) {
    val *= v.val;
    val %= 998244353;
  }
  void operator*=(long long &v) {
    val *= v;
    val %= 998244353;
  }
  long long modinv(long long a) {
    long long b = 998244353, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    u %= 998244353;
    if (u < 0) u += 998244353;
    return u;
  }
  void operator/=(const mod &v) {
    val *= modinv(v.val);
    val %= 998244353;
  }
  void operator/=(long long &v) {
    val *= modinv(v);
    val %= 998244353;
  }
};
struct p {
  long long a;
  int b;
  int c;
};
int main() {
  int n, s;
  cin >> n >> s;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  mod sum(0);
  vector<vector<int>> nap(n, vector<int>(s + 1, 0));
  for (int p = 0; p < n; p++) {
    nap[p][0] = 1;
    for (int j = 1; j <= s; j++) nap[p][j] = 0;
    if (a[p] <= s) nap[p][a[p]] = 1;
    if (a[p] == s) sum += 1;
    for (int i = p + 1; i < n; i++) {
      for (int j = 0; j <= s; j++)
        if (a[i] > j)
          nap[i][j] = nap[i - 1][j];
        else
          nap[i][j] = nap[i - 1][j] + nap[i - 1][j - a[i]];
      sum += nap[i][s];
    }
  }
  printf("%lld", sum.val);
  return 0;
}
