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