#include <bits/stdc++.h>
using namespace std;
using lint = long long;
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> x(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
  }
  const int s_max = 3000;
  vector<vector<vector<int>>> dp(
      n + 1, vector<vector<int>>(n + 1, vector<int>(s_max)));
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      for (int s = 0; s < s_max; s++) {
        dp[i][j][s] += dp[i - 1][j][s];
        if (j > 0 and s >= x[i]) {
          dp[i][j][s] += dp[i - 1][j - 1][s - x[i]];
        }
      }
    }
  }
  lint ans = 0;
  for (int j = 1; j <= n; j++) {
    if (a * j < s_max) {
      ans += lint(dp[n][j][a * j]);
    }
  }
  cout << ans << endl;
  return 0;
}
