#include <bits/stdc++.h>
using namespace std;
template <typename T>
void out(T x) {
  cout << x << endl;
  exit(0);
}
const long long mod = 998244353;
const int maxn = 1e6 + 5;
int n;
long long s;
long long a[maxn];
long long acc[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cin >> s;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    acc[i] = a[i];
    acc[i] += acc[i - 1];
  }
  long long ans = 0;
  for (int l = 1; l <= n; l++) {
    for (long long r = l; r <= n; r++) {
      map<long long, long long> mp;
      mp[0] = 1;
      for (int i = l; i <= r; i++) {
        map<long long, long long> _mp = mp;
        for (auto p : mp) {
          if (p.first + a[i] <= s) {
            _mp[p.first + a[i]] += p.second;
            _mp[p.first + a[i]] %= mod;
          }
        }
        swap(mp, _mp);
      }
      ans += mp[s];
      ans %= mod;
    }
  }
  ans %= mod;
  ans += mod;
  ans %= mod;
  out(ans);
  return 0;
}
