#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return b;
  } else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return a / gcd(a, b) * b;
}
long long x[50];
vector<long long> fir, sec;
signed main() {
  long long n, a;
  cin >> n >> a;
  long long ans = 0;
  for (long long i = 0; i < n; i++) cin >> x[i];
  for (long long j = 0; j < (1 << n); j++) {
    double sum = 0, cnt = 0;
    for (long long i = 0; i < n; i++) {
      if (j & (1 << i)) {
        sum += (double)x[i];
        cnt++;
      }
    }
    if (cnt && sum / cnt == a) {
      ans++;
    }
  }
  cout << ans << endl;
}
