#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
constexpr int MOD = 998244353;
ll calc(vector<vector<vll>>& dp, const vll& a, int i, int j, int k) {
  if (dp[i][j][k] != -1) {
    return dp[i][j][k];
  }
  if (k == 0) {
    return dp[i][j][k] = 1;
  }
  if (i == j) {
    return dp[i][j][k] = ((a[i] == k) ? 1 : 0);
  }
  ll tmp = calc(dp, a, i, j - 1, k);
  if (k - a[j] >= 0) {
    tmp = (tmp + calc(dp, a, i, j - 1, k - a[j])) % MOD;
  }
  return dp[i][j][k] = tmp;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, s;
  cin >> n >> s;
  vll a(n);
  for (int i = 0; i < (int)(n); ++i) {
    cin >> a[i];
  }
  vector<vector<vll>> dp(n, vector<vll>(n, vll(s + 1, -1)));
  ll ans = 0;
  for (int i = 0; i < (int)(n); ++i) {
    for (int j = i; j < (int)(n); ++j) {
      ans = (ans + calc(dp, a, i, j, s));
    }
  }
  cout << ans << endl;
  return 0;
}
