#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n, a;
  cin >> n >> a;
  vector<long long int> arr(n + 1, 0);
  for (long long int i = 1; i <= n; i++) cin >> arr[i];
  long long int limit = 10000;
  vector<vector<vector<long long int>>> dp(
      n + 1,
      vector<vector<long long int>>(limit, vector<long long int>(100, 0)));
  dp[0][0][0] = 1;
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 0; j < limit; j++) {
      if (j == 0) {
        dp[i][j][0] = 1;
        continue;
      }
      for (long long int k = 1; k < 100; k++) {
        if ((j - arr[i]) >= 0) {
          dp[i][j][k] += dp[i - 1][j][k] + dp[i - 1][j - arr[i]][k - 1];
        } else {
          dp[i][j][k] += dp[i - 1][j][k];
        }
      }
    }
  }
  long long int ans = 0;
  for (long long int j = 1; j < limit; j++) {
    for (long long int k = 1; k < 100; k++) {
      if (dp[n][j][k] && ((j % k) == 0)) {
        long long int mul = j / k;
        if (mul == a) ans += dp[n][j][k];
      }
    }
  }
  cout << ans << endl;
  return 0;
}
