#include <bits/stdc++.h>
using namespace std;
using Pi = pair<int, int>;
using ll = long long;
const int INF = 1 << 28;
string to_string(string s) { return s; }
template <class T>
string to_string(vector<T> v) {
  string ret = "{";
  for (int i = 0; i < v.size() - 1; ++i) {
    ret += to_string(v[i]) + ",";
  }
  if (v.size() > 0) {
    ret += to_string(v.back());
  }
  ret += "}";
  return ret;
}
void debug() { cerr << endl; }
template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}
void print() { cout << endl; }
template <class Head, class... Tail>
void print(Head head, Tail... tail) {
  cout << to_string(head);
  print(tail...);
}
void get() {}
template <class Head, class... Tail>
void get(Head& head, Tail&... tail) {
  cin >> head;
  get(tail...);
}
template <class T>
void getv(vector<T>& vec) {
  for (int i = 0; i < vec.size(); ++i) cin >> vec[i];
}
int main() {
  int N, A;
  get(N, A);
  vector<int> x(N);
  getv(x);
  int just = 0;
  vector<int> less, more;
  for (int i = 0; i < (int)N; i++) {
    if (x[i] == A) {
      just++;
    } else if (x[i] < A) {
      less.push_back(A - x[i]);
    } else {
      more.push_back(x[i] - A);
    }
  }
  vector<int> dpl(2500), dpm(2500);
  dpl[0] = 1, dpm[0] = 1;
  for (int i = 0; i < less.size(); ++i) {
    int x = less[i];
    for (int j = 2499 - x; j >= 0; --j) {
      dpl[j + x] += dpl[j];
    }
  }
  for (int i = 0; i < more.size(); ++i) {
    int x = more[i];
    for (int j = 2499 - x; j >= 0; --j) {
      dpm[j + x] += dpm[j];
    }
  }
  ll ans = 0;
  for (int i = 0; i < 2500; ++i) {
    ans += dpl[i] * dpm[i];
  }
  for (int i = 0; i < (int)just; i++) ans *= 2;
  ans--;
  print(ans);
  return 0;
}
