#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long int mas, N, A, x[56], i, j, sum = 0;
  cin >> N >> A;
  for (i = 0; i < N; i++) {
    cin >> x[i];
    sum = sum + x[i];
  }
  long long int ans = 0;
  for (mas = 1; mas < (1 << (N)); mas++) {
    long long int sumr = 0, suml, r = 0, l = 0;
    for (j = 0; j < N; j++) {
      if ((1 << j) & mas) {
        sumr = sumr + x[j];
        r++;
      }
    }
    suml = sum - sumr;
    l = N - r;
    if (sumr == r * A) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
