#include <bits/stdc++.h>
using namespace std;
int n;
double a;
int x[55];
map<int, int> m;
int len;
struct Node {
  int it;
  int cnt;
  bool operator<(const Node &r) const { return it < r.it; }
};
vector<Node> cnt;
long long int comb(long long int all, long long int select) {
  if (select == 0) return 1;
  if (all == select) return 1;
  long long int res = 1;
  long long int len = min(all - select, select);
  for (int i = 0; i < (len); i++) {
    res *= all - i;
    res /= i + 1;
  }
  return res;
}
long long int solve(int index, int sum, int sel) {
  long long int ans = 0;
  Node node = cnt[index];
  if (sel == 0) {
    if (index == len) return 0;
    for (int i = 0; i < (node.cnt + 1); i++) {
      ans += comb(node.cnt, i) * solve(index + 1, sum + i * node.it, sel + i);
    }
    return ans;
  }
  double ave = (double)sum / sel;
  if (index == len) {
    if (ave == a)
      return 1;
    else
      return 0;
  }
  for (int i = 0; i < (node.cnt + 1); i++) {
    ans += comb(node.cnt, i) * solve(index + 1, sum + i * node.it, sel + i);
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> a;
  for (int i = 0; i < (n); i++) cin >> x[i];
  for (int i = 0; i < (n); i++) m[x[i]]++;
  priority_queue<Node> q;
  for (int i = 0; i < (50); i++) {
    if (0 < m[i + 1]) {
      q.push({i + 1, m[i + 1]});
      len++;
    }
  }
  while (!q.empty()) {
    Node node = q.top();
    q.pop();
    cnt.push_back(node);
  }
  cout << solve(0, 0, 0) << endl;
  return 0;
}
