#include <bits/stdc++.h>
using namespace std;
template <class T>
long long size(const T& x) {
  return x.size();
}
template <class T>
T smod(T a, T b) {
  return (a % b + b) % b;
}
const int INF = ~(1 << 31);
const double pi = acos(-1);
const double EPS = 1e-9;
long long n, s;
vector<long long> A;
map<pair<int, pair<long long, long long> >, int> mem;
long long dp(int at, int last, int sm) {
  if (at == n || sm > s) return 0;
  if (mem.find(pair<int, pair<long long, long long> >(
          at, pair<long long, long long>(last, sm))) != mem.end()) {
    return mem[pair<int, pair<long long, long long> >(
        at, pair<long long, long long>(last, sm))];
  }
  long long tot = 0;
  if (sm == 0) {
    if (A[at] == s)
      tot += (at + 1) * (n - at);
    else
      tot += dp(at + 1, at, sm + A[at]);
    tot += dp(at + 1, last, sm);
  } else {
    if (sm + A[at] == s)
      tot += (last + 1) * (n - at);
    else
      tot += dp(at + 1, last, sm + A[at]);
    tot += dp(at + 1, last, sm);
  }
  return mem[pair<int, pair<long long, long long> >(
             at, pair<long long, long long>(last, sm))] = tot % 998244353;
  ;
}
int main() {
  cin >> n >> s;
  A = vector<long long>(n);
  for (long long i = (0); i < (n); i++) cin >> A[i];
  cout << dp(0, 0, 0) << endl;
}
