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