#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, target, arr[100], mgm = 0, ans = 0;
  cin >> n >> target;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < (1 << n); ++i) {
    double sum = 0, mgm = 0;
    for (int k = 0; k < n; ++k) {
      if (((i >> k) & 1)) {
        sum += arr[k];
        mgm++;
      }
    }
    if (sum != 0) {
      if (sum / mgm == target) {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
