#include <bits/stdc++.h>
using namespace std;
vector<int> input;
vector<int> diff_count;
int main(int argc, char* argv[]) {
  int N, S;
  cin >> N >> S;
  diff_count.resize(3001, 0);
  input.resize(N);
  int a;
  for (int i = 0; i < N; ++i) {
    cin >> a;
    input[i] = a;
  }
  long long mod = 998244353;
  long long ret = 0;
  diff_count[S] = 1;
  for (int L = 0; L < N; ++L) {
    for (int R = L; R < N; ++R) {
      if (input[R] > S) {
        continue;
      }
      for (int i = input[R]; i <= S; ++i) {
        diff_count[i - input[R]] += diff_count[i] % mod;
        diff_count[i - input[R]] %= mod;
      }
      ret += diff_count[0] % mod;
    }
    std::fill(diff_count.begin(), diff_count.end(), 0);
    diff_count[S] = 1;
  }
  cout << ret % mod << endl;
}
