#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
const int DX[] = {1, 0, -1, 0}, DY[] = {0, -1, 0, 1};
const long long MOD = 998244353;
void solve(long long N, long long S, std::vector<long long> A) {
  long long ans = 0;
  for (int i = 0; i < (N); i++) {
    map<int, int> memo;
    memo[0] = 1;
    for (int j = (i); j < (N); j++) {
      map<int, int> tmp;
      for (const auto& [key, value] : memo) {
        if (key + A[j] <= S) {
          if (tmp.count(key + A[j]) == 1) {
            tmp[key + A[j]] += value;
            tmp[key + A[j]] %= MOD;
          } else {
            tmp[key + A[j]] = value;
          }
        }
        if (tmp.count(key) == 1) {
          tmp[key] += value;
          tmp[key] %= MOD;
        } else {
          tmp[key] = value;
        }
      }
      memo = tmp;
      ans += memo[S];
      ans %= MOD;
    }
  }
  cout << ans << endl;
}
int main() {
  long long N;
  scanf("%lld", &N);
  long long S;
  scanf("%lld", &S);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  solve(N, S, std::move(A));
  return 0;
}
