#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 998244353;
long long INF = 6001001001001001001;
long double EPS = 1e-6;
long double PI = 3.141592653589793238;
template <typename T>
void remove(std::vector<T>& vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}
using Graph = vector<vector<long long>>;
int main() {
  long long N, K;
  cin >> N >> K;
  vector<long long> A(N);
  vector<pair<long long, long long>> B;
  for (long long i = (long long)0; i < (long long)N; i++) cin >> A[i];
  long long ans = 0;
  for (long long i = (long long)0; i < (long long)N; i++) {
    if (A[i] > K) continue;
    unordered_map<long long, long long> mp;
    mp[A[i]]++;
    if (A[i] == K) {
      ans += (i + 1) * (N - i);
      ans %= MOD;
    }
    for (long long j = (long long)i + 1; j < (long long)N; j++) {
      long long t = mp.size(), cnt = 0;
      for (auto itr = mp.begin(); itr != mp.end() && cnt < t; itr++) {
        long long a = itr->first, b = itr->second;
        mp[a + A[j]] += b;
        while (mp[a + A[j]] > MOD) mp[a + A[j]] -= MOD;
        if (a + A[j] == K) {
          ans += (i + 1) * (N - j);
          ans %= MOD;
        }
        cnt++;
      }
    }
  }
  cout << ans % MOD << endl;
}
