#include <bits/stdc++.h>
using namespace std;
bool is_strong_pa(const string& s, int from, int to) {
  bool is_pal = true;
  for (int i = from; i <= (to - from) / 2; ++i) {
    if (s[i] != s[to - i]) {
      is_pal = false;
      break;
    }
  }
  return is_pal;
}
int main() {
  const int MOD = 998244353;
  int n, S;
  cin >> n >> S;
  vector<int> a(n);
  int ai;
  for (int i = 0; i < n; ++i) {
    cin >> ai;
    a[i] = ai;
  }
  const int nax = 301;
  vector<vector<vector<int>>> dp(nax,
                                 vector<vector<int>>(nax, vector<int>(nax, 0)));
  long long sum = 0;
  for (int l = n - 1; l >= 0; --l) {
    for (int r = l; r < n; ++r) {
      for (int s = 0; s <= S; ++s) {
        if (s == 0)
          dp[l][r][s] = 1;
        else if (l == r)
          dp[l][r][s] = a[l] == s ? 1 : 0;
        else {
          dp[l][r][s] = dp[l][r - 1][s];
          if (s - a[r] >= 0) {
            dp[l][r][s] += dp[l][r - 1][s - a[r]];
          }
        }
        if (s == S) {
          sum = (sum + dp[l][r][s]) % MOD;
        }
      }
    }
  }
  cout << sum;
}
