#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n, a;
vector<ll> x(50);
ll d[51][2501] = {};
void dp(ll i, ll k, ll s) {
  if (i == n) {
    d[k][s]++;
    return;
  }
  dp(i + 1, k, s);
  dp(i + 1, k + 1, s + x[i]);
}
int main() {
  ll ans = 0;
  cin >> n >> a;
  for (ll i = 0; i < n; i++) cin >> x[i];
  dp(0, 0, 0);
  for (ll i = 1; i < n; i++) {
    ans += d[i][i * a];
  }
  cout << ans << endl;
  return 0;
}
