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