#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n, a;
  cin >> n >> a;
  int x[n + 1], sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    sum += x[i];
  }
  int dp[n + 1][n + 1][sum + 1];
  memset(dp, 0, sizeof(dp));
  dp[0][0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k <= sum; k++) {
        if (k + x[i] <= sum) dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
        dp[i + 1][j][k] += dp[i][j][k];
      }
    }
  }
  ll ans = 0;
  for (int j = 1; j <= n; j++) {
    for (int k = 0; k <= sum; k++) {
      if (k == a * j) ans += dp[n][j][k];
    }
  }
  cout << ans << endl;
  return 0;
}
