#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n, a, num, cnt = 0;
  cin >> n >> a;
  vector<ll> x(n);
  for (ll i = 0; i < n; i++) {
    cin >> num;
    x[i] = num - a;
  }
  for (ll bit = 1; bit < (1 << n); bit++) {
    ll sum = 0;
    for (ll i = 0; i < n; i++) {
      if (bit & (1 << i)) sum += x[i];
    }
    if (sum == 0) cnt++;
  }
  cout << cnt << endl;
}
