#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, A;
  cin >> n >> A;
  long long x[n];
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
  }
  long long sum = 0;
  long long count = 0;
  long long ans = 0;
  for (int bit = 0; bit < (1 << n); ++bit) {
    for (int i = 0; i < n; i++) {
      if (bit & (1 << i)) {
        sum += x[i];
        count++;
      }
    }
    if (sum == count * A && sum != 0) {
      ans++;
    }
    count = 0;
    sum = 0;
  }
  cout << ans << endl;
  return 0;
}
