#include <bits/stdc++.h>
using namespace std;
int a[100], d[100], x[100], ans, n, A;
bool check(int mask) {
  for (int i = 0; i < n; i++) {
    a[i] = mask % 2;
    mask /= 2;
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) cnt += a[i];
  int sum = 0;
  for (int i = 0; i < n; i++) sum += a[i] * x[i];
  return cnt * A == sum;
}
int main() {
  cin >> n >> A;
  for (int i = 0; i < n; i++) cin >> x[i];
  d[0] = 1;
  for (int i = 1; i < 20; i++) d[i] = d[i - 1] * 2;
  d[0] = 1;
  for (int mask = 1; mask < d[n]; mask++)
    if (check(mask)) ans++;
  cout << ans;
  return 0;
}
