#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];
  int X = A;
  for (int i = 0; i < N; ++i) X = max(x[i], X);
  vector<vector<vector<long long>>> dp(
      N + 1,
      vector<vector<long long>>(N + 1, vector<long long>(N * A + X + 1)));
  dp[0][0][0] = 1;
  for (int j = 0; j < N; ++j) {
    for (int k = 0; k < N; ++k) {
      for (int s = 0; s < N * X; ++s) {
        dp[j + 1][k + 1][s + x[j]] = dp[j][k][s];
        dp[j + 1][k][s] += dp[j][k][s];
      }
    }
  }
  long long ans = 0;
  for (int k = 1; k <= N; ++k) ans += dp[N][k][k * A];
  cout << ans << endl;
}
