#include <bits/stdc++.h>
using namespace std;
int n, a;
int x;
vector<int> cards;
int main() {
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    cin >> x;
    cards.push_back(x);
  }
  long long int s = (long long int)1 << n;
  int ans = 0;
  for (int i = 0; i < s; i++) {
    int cnt = 0;
    long long int sum = 0;
    for (int j = 0; j < n; j++) {
      if ((1 << j) & i) {
        cnt++;
        sum += cards[j];
      }
    }
    if (cnt > 0 && 1.0 * sum / cnt == (double)a) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
