#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int cut = 998244353;
int main() {
  int n, s;
  cin >> n >> s;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  vector<int> q(s + 1);
  int ans = 0;
  for (int i = 0; i < (n); ++i) {
    q[0] += 1;
    q[0] %= cut;
    {
      vector<int> q2(s + 1);
      for (int j = 0; j < (s + 1); ++j) {
        q[j] %= cut;
        q2[j] += q[j];
        if (j + a[i] <= s) q2[j + a[i]] += q[j];
        q2[j + a[i]] %= cut;
      }
      q = q2;
    }
    ans += q[s];
    ans %= cut;
  }
  cout << ans << endl;
  return 0;
}
