#include <bits/stdc++.h>
using namespace std;
void YES() { cout << "YES" << endl; }
void NO() { cout << "NO" << endl; }
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void yes() { cout << "yes" << endl; }
void no() { cout << "no" << endl; }
void digit(int d) { cout << fixed << setprecision(d); }
int n, a, x[50];
bool used[50];
long long ans = 0;
void dfs(int d) {
  if (d == n) {
    int sum = 0, cnt = 0;
    for (int i = 0; i < n; ++i) {
      if (used[i]) {
        sum += x[i];
        cnt++;
      }
    }
    if (cnt > 0 && sum == a * cnt) ans++;
    return;
  }
  dfs(d + 1);
  used[d] = true;
  dfs(d + 1);
  used[d] = false;
}
int main() {
  cin >> n >> a;
  for (int i = 0; i < n; ++i) {
    cin >> x[i];
  }
  dfs(0);
  cout << ans << endl;
  return 0;
}
