#include <bits/stdc++.h>
using namespace std;
const int INF = 1e8;
const int 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, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
long long N, S;
vector<long long> A;
int f(int i, int j) {
  if (i == j) {
    if (A[i] == S)
      return 1;
    else
      return 0;
  }
  int cnt = j - i + 1;
  int dp[cnt + 1][S + 1];
  dp[0][0] = 1;
  for (int k = 0; k < cnt; k++) {
    for (int m = 0; m <= S; m++) {
      dp[k + 1][m] += dp[k][m];
      if (m + A[i + k] <= S) {
        dp[k + 1][m + A[i + k]] += dp[k][m];
      }
    }
  }
  return dp[cnt][S];
}
int main() {
  cin >> N >> S;
  A.resize(N);
  mint ans = 0;
  for (int i = 0; i < (N); ++i) cin >> A[i];
  for (int i = 0; i < (N); ++i)
    for (int j = 0; j < (N); ++j) {
      if (i > j) continue;
      ans += f(i, j);
    }
  cout << ans << endl;
}
