#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double EPS = 1e-9;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long a[3005];
long long n, s;
map<pair<long long, pair<long long, long long> >, long long> ma;
long long f(long long i, long long sum, long long first) {
  if (ma[pair<long long, pair<long long, long long> >(
          i, pair<long long, long long>(sum, first))])
    return ma[pair<long long, pair<long long, long long> >(
        i, pair<long long, long long>(sum, first))];
  if (sum > s) return 0;
  if (sum == s) {
    long long tmp = (first + 1) * (n - i + 1);
    return ma[pair<long long, pair<long long, long long> >(
               i, pair<long long, long long>(sum, first))] = tmp % 998244353;
  }
  if (i == n) return 0;
  long long ret = 0;
  ret += f(i + 1, sum + a[i], first);
  if (first != i) ret += f(i + 1, sum, first);
  return ma[pair<long long, pair<long long, long long> >(
             i, pair<long long, long long>(sum, first))] = ret % 998244353;
}
signed main(void) {
  cin >> n >> s;
  for (long long i = 0; i < (n); i++) cin >> a[i];
  long long ans = 0;
  for (long long i = 0; i < (n); i++) ans += f(i, 0, i), ans %= 998244353;
  cout << ans << endl;
}
