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