#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long mod = 998244353;
const int N = 3005;
int a[N];
long long f[N];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    memset(f, 0, sizeof f);
    f[0] = 1;
    for (int j = i; j <= n; j++) {
      for (int k = m; k >= a[j]; k--) {
        f[k] += f[k - a[j]];
        f[k] %= mod;
      }
      ans += f[m];
      ans %= mod;
    }
  }
  cout << ans << endl;
  return 0;
}
