#include <bits/stdc++.h>
using namespace std;
int main() {
  int mod = 998244353;
  int n, s;
  cin >> n >> s;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  vector<vector<unordered_map<int, long long>>> dp(
      n, vector<unordered_map<int, long long>>(n));
  long long ans = 0;
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < n - i; j++)
      if (i == 0) {
        dp[j][j][a[j]]++;
        if (a[j] == s) ans++;
      } else
        for (const auto& [key, value] : dp[j][j + i - 1]) {
          if (key == s) ans = (ans + value) % mod;
          dp[j][j + i][key] = (dp[j][j + i][key] + value) % mod;
          for (const auto& [key2, value2] : dp[j + i][j + i]) {
            if (key2 == s) ans = (ans + value2) % mod;
            dp[j][j + i][key2] = (dp[j][j + i][key2] + value2) % mod;
            dp[j][j + i][key + key2] =
                (dp[j][j + i][key + key2] + key * key2) % mod;
          }
        }
  cout << ans % mod << endl;
}
