#include <bits/stdc++.h>
using namespace std;
constexpr int mod = 1000000007;
constexpr int mod1 = 998244353;
vector<int> dx = {0, 1, 0, -1}, dy = {-1, 0, 1, 0};
bool inside(int y, int x, int h, int w) {
  if (y < h && y >= 0 && x < w && x >= 0) return true;
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, a;
  cin >> n >> a;
  vector<int> x(n);
  for (int i = 0; i < (n); ++i) {
    cin >> x.at(i);
    x.at(i) -= a;
  }
  vector<int> b, c;
  int m = (n + 1) / 2;
  for (int i = 0; i < ((1 << m)); ++i) {
    int sum = 0;
    for (int j = 0; j < (m); ++j) {
      if (i & (1 << j)) sum += x.at(j);
    }
    b.push_back(sum);
  }
  for (int i = 0; i < ((1 << n / 2)); ++i) {
    int sum = 0;
    for (int j = 0; j < (n / 2); ++j) {
      if (i & (1 << j)) sum += x.at(j + m);
    }
    c.push_back(sum);
  }
  sort(c.begin(), c.end());
  long long ans = 0;
  for (int i = 0; i < (b.size()); ++i) {
    ans += upper_bound(c.begin(), c.end(), -b.at(i)) -
           lower_bound(c.begin(), c.end(), -b.at(i));
  }
  cout << ans - 1 << endl;
}
