#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, A;
  cin >> N >> A;
  int x[N];
  for (int i = 0; i < (int)(N); ++i) cin >> x[i];
  if (N > 16) {
    cout << 0 << endl;
    exit(0);
  }
  int ans = 0;
  int M = 1 << N;
  for (int i = 0; i < M; i++) {
    float t1 = 0, t2 = 0;
    for (int j = 0; j < (int)(N); ++j) {
      if ((i >> j) & 1) {
        t1 += x[j];
        t2++;
      }
    }
    if (t2 && t1 / t2 == A) ans++;
  }
  cout << ans << endl;
  return 0;
}
