#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline long long toLL(string s) {
  long long v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, a;
  cin >> n >> a;
  vector<int> v(n);
  for (long long i = 0; i < (long long)(n); i++) cin >> v[i];
  long long mp1[60 * 60];
  memset(mp1, 0, sizeof(mp1));
  long long lim = 1LL << min(n, 25);
  long long lim2 = min(n, 25);
  for (long long bit = 0; bit < (long long)(lim); bit++) {
    long long sum = 0;
    for (long long j = 0; j < (long long)(lim2); j++) {
      if ((bit >> j) & 1) {
        sum += v[j] - a;
      }
    }
    mp1[sum + (60 * 30)]++;
  }
  long long mp2[60 * 60];
  lim = (1LL << max(n - 25, 0));
  lim2 = max(n - 25, 0);
  memset(mp2, 0, sizeof(mp2));
  for (long long bit = 0; bit < (long long)(lim); bit++) {
    long long sum = 0;
    for (long long j = 0; j < (long long)(lim2); j++) {
      if ((bit >> j) & 1) {
        sum += v[j + 25] - a;
      }
    }
    mp2[sum + (60 * 30)]++;
  }
  long long ans = 0;
  for (long long i = 0; i < (long long)((60 * 60)); i++) {
    long long need = i - (60 * 30);
    need = -need;
    need += (60 * 30);
    ans += mp2[need] * mp1[i];
  }
  cout << ans - 1 << endl;
  return 0;
}
