#include <bits/stdc++.h>
using namespace std;
vector<long long> vec;
vector<long long> used;
long long dfs(long long pos, long long n, long long a) {
  if (pos == n) {
    long long sum = 0, cnt = 0;
    for (long long i = 0; i < n; i++) {
      if (used[i]) {
        sum += vec[i];
        cnt++;
      }
    }
    if ((double)a == ((double)sum / cnt)) {
      return 1;
    }
    return 0;
  }
  long long ans = 0;
  if (used[pos] < 0) {
    used[pos] = 1;
    ans += dfs(pos + 1, n, a);
    used[pos] = 0;
    ans += dfs(pos + 1, n, a);
    used[pos] = -1;
  }
  return ans;
}
int main() {
  long long n, a;
  cin >> n, cin >> a;
  for (long long i = 0; i < n; i++) {
    long long t;
    cin >> t;
    vec.push_back(t);
  }
  if (n >= 17) {
    return 1;
  }
  vector<long long> _used(n, -1);
  used = _used;
  cout << dfs(0, n, a) << endl;
  return 0;
}
