#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
using namespace std;
int main() {
  ll n, a;
  cin >> n >> a;
  ll zero = 0, pl = 0, mi = 0;
  vector<ll> plv, miv;
  for (int i = int(0); i < int(n); i += 1) {
    ll x;
    cin >> x;
    if (x > a) {
      plv.push_back(x - a);
      pl += x - a;
    } else if (x < a) {
      miv.push_back(a - x);
      mi += a - x;
    } else
      zero++;
  }
  sort(plv.begin(), plv.end());
  ll p = plv.size();
  sort(miv.begin(), miv.end());
  ll m = miv.size();
  vector<ll> p_dp(pl + 1, 0);
  p_dp[0] = 1;
  for (int i = int(0); i < int(p); i += 1)
    for (int j = int(0); j < int(pl); j += 1)
      if (plv[i] + j <= pl) p_dp[plv[i] + j] += p_dp[j];
  vector<ll> m_dp(mi + 1, 0);
  m_dp[0] = 1;
  for (int i = int(0); i < int(m); i += 1)
    for (int j = int(0); j < int(mi); j += 1)
      if (miv[i] + j <= mi) m_dp[miv[i] + j] += m_dp[j];
  ll ans = 0;
  for (int i = int(1); i < int(min(pl, mi) + 1); i += 1)
    ans += p_dp[i] * m_dp[i];
  ll count = 1;
  for (int i = int(0); i < int(zero); i += 1) count *= 2;
  ans *= count;
  ans += count - 1;
  cout << ans << endl;
}
