#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  double A;
  cin >> N >> A;
  double x[50];
  for (int i = 0; i < N; i++) cin >> x[i];
  long long ans = 0;
  for (int bit = 0; bit < 1 << N; bit++) {
    double sum = 0;
    int cnt = 0;
    for (int i = 0; i < N; i++) {
      if (bit & (1 << i)) {
        sum += x[i];
        cnt++;
      }
    }
    if (sum / (cnt * 1.0) == A) ans++;
  }
  cout << ans << endl;
  return 0;
}
