#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N, A;
  cin >> N >> A;
  vector<long long> x(N);
  for (long long i = 0; i < N; i++) {
    cin >> x[i];
    x[i] -= A;
  }
  sort(x.begin(), x.end());
  long long l, r;
  l = -1;
  r = -1;
  for (long long i = 0; i < N; i++) {
    if (x[i] >= 0 && l == -1 && i != 0)
      l = i - 1;
    else if (x[i] > 0 && r == -1)
      r = i;
  }
  long long ans = 0;
  for (long long tmp = 1; tmp < (1 << N); tmp++) {
    bitset<50> s(tmp);
    long long sum = 0;
    for (long long i = 0; i < N; i++) {
      if (s.test(i)) sum += x.at(i);
    }
    if (sum == 0) ans++;
  }
  cout << ans << endl;
  return 0;
}
