#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a;
  cin >> n >> a;
  vector<int> d(n);
  for (int i = 0; i < n; i++) {
    cin >> d[i];
  }
  long long int c = 1 << n;
  long long int cc = 0;
  for (long long int i = 0; i < c; i++) {
    int k = 0;
    int r = 0;
    for (int j = 0; j < n; j++) {
      if ((i & (1 << j)) != 0) {
        k += d[j];
        r++;
      }
    }
    if (r != 0 && k % r == 0 && k / r == a) {
      cc++;
    }
  }
  cout << cc << endl;
  return 0;
}
