#include <bits/stdc++.h>
using namespace std;
vector<int> x;
vector<vector<vector<unsigned long long> > > dp;
unsigned int N, A;
unsigned long long rec(unsigned int i, unsigned int cur, int num,
                       vector<vector<vector<unsigned long long> > > &dp,
                       vector<int> &x) {
  cerr << i << " " << cur << " " << num << endl;
  if (dp[i][cur][num] < (1ull << 57)) {
    return dp[i][cur][num];
  }
  if (i == N) {
    return 0;
  } else if (A * N < cur) {
    return dp[i][cur][num] = 0;
  }
  unsigned long long res = 0;
  if (A * (num + 1) == cur + x[i]) res++;
  res += rec(i + 1, cur, num, dp, x);
  res += rec(i + 1, cur + x[i], num + 1, dp, x);
  return dp[i][cur][num] = res;
}
int main(void) {
  cin >> N >> A;
  x = vector<int>(N);
  unsigned int i;
  for (i = 0; i < N; i++) {
    scanf("%d", &x[i]);
  }
  sort(x.begin(), x.end());
  vector<vector<vector<unsigned long long> > > dp(
      N + 1, vector<vector<unsigned long long> >(
                 50 * 50 + 1, vector<unsigned long long>(N + 1, 1ull << 58)));
  cout << rec(0, 0, 0, dp, x) << endl;
  return 0;
}
