#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  long all = 1, ans = 0;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    all *= 2;
  }
  for (int i = 1; i <= all; i++) {
    int sum = 0, cnt = 0;
    for (int j = 0; j < n; j++) {
      if (i >> j & 1) {
        sum += x[j];
        cnt++;
      }
    }
    if ((double)sum / cnt == a) ans++;
  }
  cout << ans << endl;
  return 0;
}
