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