#include <bits/stdc++.h>
using namespace std;
int N, S;
long mod(long x) {
  if (x >= 998244353) return x % 998244353;
  return x;
}
long search(vector<int> &a, int l, int r, int temp, vector<long> &pdata) {
  if (temp == 0) {
    return 1;
  }
  if (l > r || (l == r && temp != a[l])) {
    return 0;
  }
  long ans = 0;
  ans += search(a, l + 1, r, temp, pdata);
  if (temp >= a[l]) {
    ans += search(a, l + 1, r, temp - a[l], pdata);
  }
  if (temp == S) {
    pdata[l] = mod(ans);
  }
  return mod(ans);
}
int main() {
  cin >> N >> S;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  long result = 0;
  for (int i = 0; i < N; i++) {
    vector<long> pdata(i + 1, 0);
    long p = search(a, 0, i, S, pdata);
    for (int j = 0; j < i + 1; j++) {
      result += pdata[j];
    }
    result = mod(result);
  }
  cout << result << endl;
  return 0;
}
