#include <bits/stdc++.h>
using namespace std;
map<pair<long long, long long>, int> mp;
long long thunder(long long a[], long long l, long long r, long long n,
                  long long s, long long tsum) {
  if (tsum == s) {
    return ((l + 1) * (n - r + 1)) % 998244353;
  }
  if (tsum > s) {
    return 0;
  }
  if (r == n) {
    return 0;
  }
  long long l1 = thunder(a, l, r + 1, n, s, tsum + a[r]);
  long long l2 = thunder(a, l, r + 1, n, s, tsum);
  mp[{r, s - tsum}] = (l1 + l2 + 998244353) % 998244353;
  return (l1 + l2 + 998244353) % 998244353;
}
int main() {
  int n, s;
  cin >> n >> s;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long count = 0;
  for (long long l = 0; l < n; l++) {
    count += thunder(a, l, l + 1, n, s, a[l]);
    count %= 998244353;
  }
  cout << (count + 998244353) % 998244353 << endl;
  return 0;
}
