#include <bits/stdc++.h>
using namespace std;
struct combination_mod {
  using long long = long long int;
  int sz;
  long long mod;
  vector<long long> fac;
  vector<long long> finv;
  combination_mod(int _sz, long long _mod) : sz(_sz), mod(_mod) {
    fac.assign(sz + 1, 1);
    finv.assign(sz + 1, 1);
    vector<long long> inv(sz + 1, 1);
    for (int i = 2; i <= sz; i++) {
      fac[i] = fac[i - 1] * i % mod;
      inv[i] = mod - inv[mod % i] * (mod / i) % mod;
      finv[i] = finv[i - 1] * inv[i] % mod;
    }
  }
  long long query(int n, int r) {
    return fac[n] * (finv[r] * finv[n - r] % mod) % mod;
  }
};
struct cumulative_sum {
  using long long = long long int;
  int sz;
  vector<long long> data;
  vector<long long> sum;
  cumulative_sum(const int _sz) : sz(_sz) {
    data.assign(sz, 0);
    sum.assign(sz + 1, 0);
  }
  long long& operator[](const int k) { return data[k]; }
  void build() {
    for (int i = 0; i < sz; i++) sum[i + 1] = sum[i] + data[i];
  }
  long long query(const int a, const int b) { return sum[b] - sum[a]; }
};
int n, s;
int main() {
  cin >> n >> s;
  long long mod = 998244353;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<vector<long long>> dp(n + 1, vector<long long>(s + 1));
  dp[0][0] = 1;
  for (int i = 0; i < n + 1; i++) {
    for (int j = 0; j <= s; j++) {
      if (j + a[i] <= s) {
        dp[i + 1][j + a[i]] += dp[i][j];
        dp[i + 1][j + a[i]] %= mod;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i < n + 1; i++) {
    for (int j = i; j < n + 1; j++) {
      ans += dp[i][s] - dp[j][s];
      ans %= mod;
    }
  }
  if (ans < 0) {
    ans += mod;
  }
  cout << ans << endl;
}
