#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);
int main() {
  long long n, a;
  cin >> n >> a;
  if (16 < n) exit(1);
  vector<long long> x(n);
  for (long long i = 0; i < (n); ++i) cin >> x[i];
  long long ans = 0;
  for (long long bit = 0; bit < (1 << n); bit++) {
    bitset<16> b = bit;
    long long sum = 0, cnt = b.count();
    for (long long i = 0; i < (n); ++i) sum += x[i] * b.test(i);
    if (cnt != 0 && sum % cnt == 0 && sum / cnt == a) ans++;
  }
  cout << (ans) << endl;
}
