#include <bits/stdc++.h>
using namespace std;
int n, a;
int x[60];
int dfs(int card, int sum, int pickedcards, bool pick) {
  sum = sum + (pick ? x[card] : 0);
  pickedcards = pickedcards + (pick ? 1 : 0);
  if (card == n - 1) {
    if (pickedcards == 0) {
      return 0;
    }
    if (sum % pickedcards == 0 && a == sum / pickedcards) {
      sum = 0;
      pickedcards = 0;
      return 1;
    } else {
      sum = 0;
      pickedcards = 0;
      return 0;
    }
  }
  int ret;
  ret = dfs(card + 1, sum, pickedcards, true) +
        dfs(card + 1, sum, pickedcards, false);
  return ret;
}
int main() {
  cin >> n >> a;
  if (n > 16) return 0;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  cout << dfs(0, 0, 0, true) + dfs(0, 0, 0, false) << endl;
}
