#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
template <class T>
inline void chmax(T& a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T& a, T b) {
  a = std::min(a, b);
}
template <ll ModVal>
struct ModInt {
  ll x;
  ModInt(ll _x = 0) : x((_x % ModVal + ModVal) % ModVal) {}
  ModInt operator-() const { return ModInt(-x); }
  ModInt& operator+=(const ModInt a) {
    x += a.x;
    if (x >= ModVal) x -= ModVal;
    return *this;
  }
  ModInt& operator-=(const ModInt a) {
    x = x + ModVal - a.x;
    if (x >= ModVal) x -= ModVal;
    return *this;
  }
  ModInt& operator*=(const ModInt a) {
    x *= a.x;
    x %= ModVal;
    return *this;
  }
  ll ext_gcd(ll a, ll b, ll& x, ll& y) {
    if (b == 0) {
      x = 1;
      y = 0;
      return a;
    }
    ll tmp = a / b;
    ll d = ext_gcd(b, a - b * tmp, y, x);
    y -= tmp * x;
    return d;
  }
  ModInt inv(const ModInt a) {
    ll u, v;
    ext_gcd(a.x, ModVal, u, v);
    return ModInt(u);
  }
  ModInt& operator/=(const ModInt a) { return (*this) *= inv(a); }
  ModInt operator+(const ModInt a) const {
    ModInt retval(*this);
    return retval += a;
  }
  ModInt operator-(const ModInt a) const {
    ModInt retval(*this);
    return retval -= a;
  }
  ModInt operator*(const ModInt a) const {
    ModInt retval(*this);
    return retval *= a;
  }
  ModInt operator/(const ModInt a) const {
    ModInt retval(*this);
    return retval /= a;
  }
  ModInt pow(ll n) {
    ModInt ans(1);
    while (n) {
      if (n & 1) ans = ans * x;
      *this = (*this) * (*this);
      n = n >> 1;
    }
    return ans;
  }
  constexpr const ll& value() { return this->x; }
};
template <ll ModVal>
ostream& operator<<(ostream& os, const ModInt<ModVal>& a) {
  os << a.x;
  return os;
}
using mint = ModInt<(ll)(998244353)>;
template <typename T>
class Combination {
 public:
  Combination(ll _max_n) : max_n(_max_n), factional(max_n + 1), inv(max_n + 1) {
    factional[0] = 1;
    inv[0] = 1;
    for (ll i = 0; i < max_n; i++) {
      factional[i + 1] = factional[i] * (i + 1);
      inv[i + 1] = inv[i] / (i + 1);
    }
  }
  T choose(ll n, ll k) {
    if (n == 0 && k == 0) return 1;
    if (n < k || n < 0) return 0;
    T tmp = inv[n - k] * inv[k];
    return tmp * factional[n];
  }

 private:
  const ll max_n;
  std::vector<T> factional;
  std::vector<T> inv;
};
using Comb = Combination<mint>;
template <typename T>
class SegTree {
  int n;
  vector<T> data;
  T initial_value;
  function<T(T a, T b)> operation;
  function<T(T prev_val, T new_val)> _update;
  T query(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l) {
      return initial_value;
    }
    if (a <= l && r <= b) {
      return data[k];
    } else {
      T vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
      T vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
      return operation(vl, vr);
    }
  }

 public:
  SegTree(size_t _n, T _initial_value, function<T(T a, T b)> _operation,
          function<T(T prev_val, T new_val)> update_function)
      : initial_value(_initial_value),
        operation(_operation),
        _update(update_function) {
    n = 1;
    while (n < _n) {
      n <<= 1;
    }
    data = vector<T>(2 * n - 1, initial_value);
  }
  void update(int i, T x) {
    i += n - 1;
    data[i] = _update(data[i], x);
    while (i > 0) {
      i = (i - 1) / 2;
      data[i] = operation(data[i * 2 + 1], data[i * 2 + 2]);
    }
  }
  T query(int a, int b) { return query(a, b, 0, 0, n); }
  T operator[](int i) { return data[i + n - 1]; }
};
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll n, s;
  cin >> n >> s;
  vll a(n + 1);
  for (ll i = 1; i < n + 1; i++) {
    cin >> a[i];
  }
  mint ans = 0;
  for (ll l = 1; l < n + 1; l++) {
    vector<map<ll, mint>> dp(n + 1);
    dp[0][0] = 1;
    for (ll i = 1; i < n + 1; i++) {
      if (i < l) {
        dp[i][0] = 1;
        continue;
      }
      for (auto it = dp[i - 1].begin(); it != dp[i - 1].end(); it++) {
        dp[i][it->first] += it->second;
        dp[i][it->first + a[i]] += it->second;
      }
    }
    for (ll i = 1; i < n + 1; i++) {
      ans += dp[i][s];
    }
  }
  cout << ans << endl;
  return 0;
}
