#include <bits/stdc++.h>
using namespace std;
const int maxn = 3005;
const int mod = 998244353;
int a[maxn];
map<pair<pair<int, int>, int>, int> mem;
int solve(int l, int r, int val) {
  if (mem.count(make_pair(make_pair(l, r), val)))
    return mem[make_pair(make_pair(l, r), val)];
  if (l == r)
    return mem[make_pair(make_pair(l, r), val)] = (a[l] == val || 0 == val);
  if (val < 0) return mem[make_pair(make_pair(l, r), val)] = 0;
  int res = 0;
  res = (res + solve(l, r - 1, val)) % mod;
  res = (res + solve(l, r - 1, val - a[r])) % mod;
  return mem[make_pair(make_pair(l, r), val)] = res;
}
int main() {
  int n, s;
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++) ans = (ans + solve(i, j, s)) % mod;
  printf("%d\n", ans);
  return 0;
}
