#include <bits/stdc++.h>
using namespace std;
int N, A, i, ans, sum, cnt;
vector<int> x;
void search(int n, int v) {
  if (v == 0) {
    ans++;
    return;
  }
  if (N < n + 1 || v < 0) return;
  search(n + 1, v);
  if (x[n] <= v) search(n + 1, v - x[n]);
  return;
}
int main() {
  cin >> N >> A;
  x = vector<int>(N, 0);
  sum = 0;
  for (i = 0; i < N; i++) {
    cin >> x[i];
    sum += x[i];
  }
  ans = 0;
  cnt = 1;
  while (sum >= cnt * A) {
    search(0, cnt * A);
    cnt++;
  }
  cout << ans << endl;
  return 0;
}
