#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N);
  for (int(i) = 0; (i) < (N); (i)++) {
    cin >> x[i];
    x[i] -= A;
  }
  sort((x).begin(), (x).end());
  int x_max = x[N - 1];
  long long dp[55][5050];
  for (int(i) = 0; (i) < (55); (i)++)
    for (int(j) = 0; (j) < (5050); (j)++) dp[i][j] = 0;
  dp[0][N * x_max] = 1;
  for (int i = 0; i <= N; i++) {
    for (int j = 0; j <= 5000; j++) {
      dp[i + 1][j] += dp[i][j];
      dp[i + 1][j + x[i]] += dp[i][j];
    }
  }
  cout << dp[N][N * x_max] - 1LL << endl;
  return 0;
}
