#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, s;
  cin >> n >> s;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  for (long long l = 0; l < n; l++) {
    vector<long long> sum(s + 1, 0);
    sum[0] = 1;
    for (long long r = l; r < n; r++) {
      for (long long i = s - a[r]; i >= 0; i--) {
        sum[i + a[r]] += sum[i];
        sum[i + a[r]] %= 998244353;
      }
      long long curr_ans = sum[s];
      ans += curr_ans;
      ans %= 998244353;
    }
  }
  cout << ans << "\n";
}
