#include <bits/stdc++.h>
using namespace std;
int n, a, x[50];
unsigned long long dfs(int k, int m, int y) {
  if (k == 0) {
    if (m * a == y)
      return 1;
    else
      return 0;
  } else {
    return dfs(k - 1, m + 1, y + x[k - 1]) + dfs(k - 1, m, y);
  }
}
int main(void) {
  cin >> n >> a;
  for (int i = 0; i != n; i++) cin >> x[i];
  cout << dfs(n, 0, 0) - 1 << endl;
  return 0;
}
