#include <bits/stdc++.h>
using namespace std;
long long cnt = 0;
void solve(int i, const vector<int>& cards, int sum, int n, int a) {
  if (i == cards.size()) {
    if (a * n == sum) cnt++;
    return;
  }
  solve(i + 1, cards, sum + cards[i], n + 1, a);
  solve(i + 1, cards, sum, n, a);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, a;
  cin >> n >> a;
  vector<int> cards(n);
  for (int i = 0; i < n; i++) cin >> cards[i];
  solve(0, cards, 0, 0, a);
  cout << cnt - 1 << "\n";
  return 0;
}
