#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N, A, a, b, c;
  c = 0;
  cin >> N >> A;
  vector<long long> x(N);
  for (long long i = 0; i < N; i++) {
    cin >> a;
    x[i] = a - A;
  }
  sort(x.begin(), x.end());
  for (long long i = 1; i < pow(2, N); i++) {
    for (long long j = 0; j < N; j++)
      if (i & (1 << j)) b += x[j];
    if (b == 0) c++;
    b = 0;
  }
  cout << c << endl;
}
