#include <bits/stdc++.h>
using namespace std;
int N, A;
vector<int> x;
void dfs(vector<int> &v, int &count) {
  if (v.size() == N) {
    int sum = 0;
    for (int i = 0; i < N; i++) {
      sum += v[i] * x[i];
    }
    if (sum == 0) count++;
    return;
  }
  for (int i = 0; i < 2; i++) {
    v.push_back(i);
    dfs(v, count);
    v.pop_back();
  }
}
int main(void) {
  cin >> N >> A;
  x.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> x[i];
    x[i] -= A;
  }
  int count = 0;
  vector<int> res;
  dfs(res, count);
  cout << count - 1 << endl;
  return 0;
}
