#include <bits/stdc++.h>
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
template <class T>
void view(T e) {
  cout << e << endl;
}
template <class T>
void view(const vector<T> &v) {
  for (const auto &e : v) {
    cout << e << " ";
  }
  cout << endl;
}
template <class T>
void view(const vector<vector<T>> &vv) {
  for (const auto &v : vv) {
    view(v);
  }
}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int, int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;
int dp_pos[3000];
int dp_neg[3000];
int main() {
  int n, a;
  cin >> n >> a;
  vint pos, neg;
  int zeros = 0;
  for (int i = 0; i < (int)(n); i++) {
    int x;
    cin >> x;
    x -= a;
    if (x > 0) pos.push_back(x);
    if (x < 0) neg.push_back(x);
    if (x == 0) zeros++;
  }
  dp_pos[0] = dp_neg[0] = 1;
  for (int i = 0; i < (int)(pos.size()); i++) {
    for (int j = 2999; j >= 0; j--) {
      if (dp_pos[j] != 0) dp_pos[j + pos[i]] += dp_pos[j];
    }
  }
  for (int i = 0; i < (int)(neg.size()); i++) {
    for (int j = 2999; j >= 0; j--) {
      if (dp_neg[j] != 0) dp_neg[j - neg[i]] += dp_neg[j];
    }
  }
  ll ans = 0;
  for (int i = 1; i < (int)(3000); i++) {
    ans += dp_pos[i] * dp_neg[i] * pow(2, zeros);
  }
  ans += pow(2, zeros) - 1;
  cout << ans << endl;
}
