#include <bits/stdc++.h>
using namespace std;
int X[50];
int N, A;
long long pattern(int sum, int c, int i) {
  if (c == 0 && sum == 0) {
    return 1;
  }
  if (i < 0) return 0;
  return pattern(sum - X[i], c - 1, i - 1) + pattern(sum, c, i - 1);
}
int main() {
  cin >> N >> A;
  for (int i = 0; i < N; ++i) {
    cin >> X[i];
  }
  sort(X, X + N);
  long long pat = 0;
  for (int c = 1; c <= N; ++c) {
    long long sum = c * A;
    pat += pattern(sum, c, N - 1);
  }
  cout << pat << endl;
  return 0;
}
