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