#include <bits/stdc++.h>
using namespace std;
static const int64_t MOD = 998244353;
int main() {
  int N, S;
  cin >> N >> S;
  vector<int> A(N);
  for (int i = 0; i < (int)(N); ++i) cin >> A[i];
  int64_t ans = 0;
  for (int L = 0; L < (int)(N); ++L) {
    vector<int64_t> counts(S + 1);
    counts[0] = 1;
    for (int R = (int)(L); R < (int)(N); ++R) {
      for (int s = S; s >= 0; --s) {
        if (s - A[R] >= 0) {
          counts[s] = (counts[s] + counts[s - A[R]]) % MOD;
        }
      }
      ans = (ans + counts[S]) % MOD;
    }
  }
  cout << ans << '\n';
}
