#include <bits/stdc++.h>
long long bfs(std::vector<int> v, int pos, int val, int card) {
  if (val == 0 && card == 0) return 1;
  if (pos >= v.size() || card == 0 || v.size() - pos < card) return 0;
  long long ret = 0;
  if (val - v[pos] >= 0) {
    ret += bfs(v, pos + 1, val - v[pos], card - 1);
  }
  ret += bfs(v, pos + 1, val, card);
  return ret;
}
int main() {
  int n, a;
  std::cin >> n >> a;
  std::vector<int> v(n);
  for (int i = 0; i < n; i++) {
    std::cin >> v[i];
  }
  std::sort(v.begin(), v.end());
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += bfs(v, 0, i * a, i);
  }
  std::cout << ans << std::endl;
  return 0;
}
