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