#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int n, m;
long long ans = 0;
vector<int> v;
void rec(int st, int idx, int sum) {
  if (sum == m) {
    ans += (st + 1) * (n - idx + 1);
    ans %= 998244353;
    return;
  }
  if (idx == n) {
    return;
  }
  for (int i = idx; i < n; ++i) {
    rec(st, i + 1, sum + v[i]);
  }
}
int main() {
  cin >> n >> m;
  v = vector<int>(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  for (int i = 0; i < n; ++i) {
    rec(i, i + 1, v[i]);
  }
  cout << ans;
}
