#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 1e17;
const long long mod = 1e9 + 7;
long long modInverse(long long a, long long m) {
  long long m0 = m;
  long long y = 0, x = 1;
  if (m == 1) return 0;
  while (a > 1) {
    long long q = a / m;
    long long t = m;
    m = a % m, a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += m0;
  return x;
}
long long powm(long long a, long long b) {
  a = a % mod;
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return (res % mod);
}
const int N = 2e5 + 5;
void dpsol(vector<long long> v1, vector<long long> &dp) {
  dp[0] = 1;
  for (int i = 0; i < (long long)v1.size(); i++) {
    vector<long long> dpi(10000, 0);
    for (int j = 0; j < 10000; j++) {
      if (dp[j] != 0) {
        dpi[j] += dp[j];
        dpi[j + v1[i]] += dp[j];
      }
    }
    swap(dp, dpi);
  }
}
void solve() {
  vector<long long> v1, v2;
  long long cnt = 0, n, a;
  cin >> n >> a;
  for (int i = 0; i < n; i++) {
    int aa;
    cin >> aa;
    if (aa - a == 0) cnt++;
    if (aa - a < 0) v2.push_back(abs(aa - a));
    if (aa - a > 0) v1.push_back(aa - a);
  }
  vector<long long> dp1(10000, 0), dp2(10000, 0);
  dpsol(v1, dp1);
  dpsol(v2, dp2);
  long long ans = (1 << (cnt));
  long long tot = 0;
  for (int i = 1; i < 10000; i++) {
    if (dp1[i] != 0 && dp2[i] != 0) tot += ans * dp1[i] * dp2[i];
  }
  tot += ans - 1;
  cout << tot << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
}
