#include <bits/stdc++.h>
using ll = long long int;
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];
    X[i] -= A;
  }
  ll ans = 0;
  for (ll i = 1; i < (1 << N); i++) {
    int total = 0;
    for (ll j = 0; j < N; j++) {
      if ((i >> j) & 1) {
        total += X[j];
      }
    }
    if (total == 0) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
