#include <bits/stdc++.h>
template <std::uint_fast64_t MOD>
class ModInt {
  using u64 = std::uint_fast64_t;

 public:
  ModInt(const u64 val = 0) { value = val % MOD; }
  bool operator==(const ModInt &rhs) const { return value == rhs.value; }
  bool operator!=(const ModInt &rhs) const { return !(*this == rhs); }
  bool operator<(const ModInt &rhs) const { return value < rhs.value; }
  bool operator>(const ModInt &rhs) const { return value > rhs.value; }
  bool operator<=(const ModInt &rhs) const { return !(*this > rhs); }
  bool operator>=(const ModInt &rhs) const { return !(*this < rhs); }
  ModInt operator+(const ModInt rhs) const { return ModInt(*this) += rhs; }
  ModInt operator-(const ModInt rhs) const { return ModInt(*this) -= rhs; }
  ModInt operator*(const ModInt rhs) const { return ModInt(*this) *= rhs; }
  ModInt operator/(const ModInt rhs) const { return ModInt(*this) /= rhs; }
  ModInt &operator+=(const ModInt rhs) {
    value += rhs.value;
    if (value >= MOD) {
      value -= MOD;
    }
    return *this;
  }
  ModInt &operator-=(const ModInt rhs) {
    if (value < rhs.value) {
      value += MOD;
    }
    value -= rhs.value;
    return *this;
  }
  ModInt &operator*=(const ModInt rhs) {
    value = value * rhs.value % MOD;
    return *this;
  }
  ModInt &operator/=(ModInt rhs) {
    *this *= rhs.inv();
    return *this;
  }
  ModInt &operator++(int n) {
    value++;
    if (value >= MOD) {
      value -= MOD;
    }
    return *this;
  }
  ModInt &operator--(int n) {
    if (value == 0) {
      value += MOD;
    }
    value--;
    return *this;
  }
  ModInt inv() { return ModInt::pow(*this, MOD - 2); }
  static ModInt pow(ModInt base, long long int n) {
    ModInt res = ModInt(1);
    while (n) {
      if (n & 1) {
        res *= base;
      }
      base *= base;
      n /= 2;
    }
    return res;
  }
  static ModInt comb(ModInt n, ModInt r) { return comb(n.value, r.value); }
  static ModInt comb(int n, int r) {
    if (n < r) return ModInt(0);
    ModInt res = ModInt(1);
    for (int i = 0; i < r; i++) {
      res *= ModInt(n - i);
    }
    ModInt inv = ModInt(1);
    for (int i = 0; i < r; i++) {
      inv *= ModInt(r - i);
    }
    return res / inv;
  }
  u64 getValue() const { return value; }

 private:
  u64 value;
  friend std::ostream &operator<<(std::ostream &out, const ModInt<MOD> &m) {
    out << m.value;
    return out;
  }
  friend std::istream &operator>>(std::istream &in, ModInt &m) {
    uint_fast64_t i;
    in >> i;
    m = ModInt(i);
    return in;
  }
};
using P = std::pair<int, int>;
const int INF = 2147483647;
const long long int MOD = 1000000007;
using namespace std;
using mint = ModInt<998244353>;
int main() {
  int n, s;
  cin >> n >> s;
  vector<int> a(n);
  mint ans(0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    vector<vector<vector<mint>>> dp(
        n + 1, vector<vector<mint>>(s + 1, vector<mint>(2, mint(0))));
    if (a[i] <= s) dp[i][a[i]][1] = mint(1);
    for (int j = i + 1; j < n; j++) {
      for (int k = 0; k < s + 1; k++) {
        dp[j][k][0] += (dp[j - 1][k][0] + dp[j - 1][k][1]);
        if (k - a[j] >= 0) {
          dp[j][k][1] += (dp[j - 1][k - a[j]][0] + dp[j - 1][k - a[j]][1]);
        }
      }
    }
    for (int j = i; j < n; j++) {
      ans += dp[j][s][1] * mint(i + 1) * mint(n - j);
    }
  }
  cout << ans << endl;
}
