#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, A;
  cin >> N >> A;
  vector<int> x(N + 1);
  for (int i = 1; i <= N; ++i) {
    cin >> x[i];
  }
  vector<vector<unordered_map<double, long long>>> dp(
      N + 1, vector<unordered_map<double, long long>>(N + 1));
  for (int i = 0; i <= N; ++i) {
    ++dp[i][0][0];
  }
  for (int i = 1; i <= N; ++i) {
    for (int j = 1; j <= i; ++j) {
      for (auto &el : dp[i - 1][j - 1]) {
        double sum = el.first * (j - 1) + x[i];
        dp[i][j][sum / j] = el.second;
      }
      for (auto &el : dp[i - 1][j]) {
        dp[i][j][el.first] += el.second;
      }
    }
  }
  long long sum = 0;
  for (int i = 0; i <= N; ++i) {
    sum += dp[N][i][double(A)];
  }
  cout << sum << endl;
  cin >> N;
  return 0;
}
