#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
void ABC159F() {
  const ll MOD = 998244353;
  int N, S;
  cin >> N >> S;
  vi A(N);
  for (auto& x : A) cin >> x;
  int M = S + 1;
  vector<vvl> dp(N, vvl(N, vl(M)));
  for (int i = 0; i < N; ++i) {
    dp[i][i][0] = 1;
    if (A[i] <= S) dp[i][i][A[i]] = 1;
  }
  for (int i = 0; i < N; ++i) {
    for (int i2 = i + 1; i2 < N; ++i2) {
      for (int j = 0; j < M; ++j) {
        dp[i][i2][j] = dp[i][i2 - 1][j];
        if (j >= A[i2]) {
          dp[i][i2][j] += dp[i][i2 - 1][j - A[i2]];
        }
        dp[i][i2][j] %= MOD;
      }
    }
  }
  ll ans = 0;
  for (int i = 0; i < N; ++i) {
    for (int j = i; j < N; ++j) {
      ll x = dp[i][j][S];
      if (x < 0) x += MOD;
      ans += x;
      ans %= MOD;
    }
  }
  cout << ans << endl;
}
int main() {
  ABC159F();
  return 0;
}
