#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dy[] = {0, 0, 1, -1};
int dx[] = {
    1,
    -1,
    0,
    0,
};
void printv(vector<long long> &v) {
  for (auto e : v) cout << e << " ";
  cout << endl;
}
long long power(long long a, long long b) {
  if (a == 1) return a;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % 998244353;
    a = a * a % 998244353;
    b >>= 1;
  }
  return res;
}
const int MAX = 2100000;
long long fact[MAX], fact_inv[MAX];
void init_fact(long long n) {
  fact[0] = 1;
  for (long long i = 0; i < n; i++) fact[i + 1] = fact[i] * (i + 1) % 998244353;
  fact_inv[n] = power(fact[n], 998244353 - 2);
  for (long long i = n - 1; i >= 0; i--)
    fact_inv[i] = fact_inv[i + 1] * (i + 1) % 998244353;
}
long long comb(long long n, long long r) {
  return (fact[n] * fact_inv[r]) % 998244353 * fact_inv[n - r] % 998244353;
}
long long perm(long long n, long long r) {
  return (fact[n] * fact_inv[n - r]) % 998244353;
}
template <int mod>
struct ModInt {
  int x;
  ModInt() : x(0) {}
  ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
  ModInt &operator+=(const ModInt &p) {
    if ((x += p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator-=(const ModInt &p) {
    if ((x += mod - p.x) >= mod) x -= mod;
    return *this;
  }
  ModInt &operator*=(const ModInt &p) {
    x = (int)(1LL * x * p.x % mod);
    return *this;
  }
  ModInt &operator/=(const ModInt &p) {
    *this *= p.inverse();
    return *this;
  }
  ModInt operator-() const { return ModInt(-x); }
  ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
  ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
  ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
  ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
  bool operator==(const ModInt &p) const { return x == p.x; }
  bool operator!=(const ModInt &p) const { return x != p.x; }
  ModInt inverse() const {
    int a = x, b = mod, u = 1, v = 0, t;
    while (b > 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(u -= t * v, v);
    }
    return ModInt(u);
  }
  ModInt pow(int64_t n) const {
    ModInt ret(1), mul(x);
    while (n > 0) {
      if (n & 1) ret *= mul;
      mul *= mul;
      n >>= 1;
    }
    return ret;
  }
  friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.x; }
  friend istream &operator>>(istream &is, ModInt &a) {
    int64_t t;
    is >> t;
    a = ModInt<mod>(t);
    return (is);
  }
  static int get_mod() { return mod; }
};
using modint = ModInt<(int)(998244353)>;
int main() {
  cout << fixed << setprecision(10);
  long long n, s;
  cin >> n >> s;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  vector<vector<long long> > dp(n + 1, vector<long long>(s + 1, 0));
  for (long long i = 0; i < n; i++) {
    dp[i][0]++;
    for (long long j = 0; j < s + 1; j++) {
      dp[i + 1][j] += dp[i][j];
      if (j + a[i] > s) continue;
      dp[i + 1][j + a[i]] += dp[i][j];
    }
  }
  modint ans = 0;
  for (long long i = 0; i < n; i++) ans += dp[i + 1][s];
  cout << ans << endl;
}
