#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
long long memo[50][10001];
long long npr[51][51] = {};
long long NPR(int n, int r) {
  if (npr[n][r] != 0) return npr[n][r];
  long long ret = 1;
  for (int i = 1; i <= r; i++) ret = ret * (n - (i - 1)) / i;
  return npr[n][r] = ret;
}
long long solve(int now, int ave) {
  if (memo[now][ave + 5000] > -1) return memo[now][ave + 5000];
  if (ave > 0) return 0;
  if (now == v.size()) {
    if (ave == 0)
      return 1;
    else
      return 0;
  }
  long long ret = 0;
  for (int i = 0; i <= v[now].second; i++) {
    ret += NPR(v[now].second, i) * solve(now + 1, ave + v[now].first * i);
  }
  return memo[now][ave + 5000] = ret;
}
int main() {
  fill_n(*memo, 50 * 10001, -1);
  int N, A;
  map<int, int> m;
  cin >> N >> A;
  int in;
  for (int i = 0; i < N; i++) {
    cin >> in;
    m[in - A]++;
  }
  for (auto it = m.begin(); it != m.end(); it++) {
    v.push_back(*it);
  }
  if (N == 1) {
    if (v[0].first == 0) {
      cout << 1 << endl;
    } else {
      cout << 0 << endl;
    }
  } else {
    cout << solve(0, 0) - 1 << endl;
  }
  return 0;
}
