#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long INF = (1e18) + 1;
const long long mod = 998244353;
struct mint {
  long long x;
  mint(long long x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(long long t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
struct combination {
  vector<mint> fact, ifact;
  combination(long long n) : fact(n + 1), ifact(n + 1) {
    assert(n < mod);
    fact[0] = 1;
    for (long long i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
    ifact[n] = fact[n].inv();
    for (long long i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
  }
  mint operator()(long long n, long long k) {
    if (k < 0 || k > n) return 0;
    return fact[n] * ifact[k] * ifact[n - k];
  }
  mint p(long long n, long long k) { return fact[n] * ifact[n - k]; }
} c(1000005);
int main() {
  long long n, s;
  cin >> n >> s;
  vector<long long> a(n);
  for (long long i = 0; i < (n); i++) {
    cin >> a[i];
  }
  vector<map<pair<long long, long long>, long long>> dp(s + 1);
  mint ans = 0;
  for (long long i = 0; i < (n); i++) {
    for (long long j = 0; j <= s; j++) {
      if (j == 0) {
        if (j + a[i] <= s) {
          dp[j + a[i]][{i, i}]++;
        }
      } else {
        if (j + a[i] <= s) {
          for (auto x : dp[j]) {
            if (x.first.first == i || x.first.second == i) continue;
            dp[j + a[i]][{x.first.first, i}]++;
          }
        }
      }
    }
  }
  for (auto x : dp[s]) {
    long long le = x.first.first, ri = x.first.second;
    ans += (le + 1) * (n - ri) * x.second;
  }
  cout << ans << '\n';
  return 0;
}
