#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int main() {
  int N, K;
  cin >> N >> K;
  int l = N / 2, r = N - l;
  vector<int> A(l), B(r), C(1, 0), D(1, 0);
  for (int i = 0; i < l; i++) {
    cin >> A[i];
    A[i] -= K;
  }
  for (int i = 0; i < r; i++) {
    cin >> B[i];
    B[i] -= K;
  }
  int sum = 0;
  for (int i = 1; i < (1 << l); i++) {
    int code = (i ^ (i >> 1)), pos = __builtin_ctz(i);
    if (((1 << pos) & code) != 0)
      sum += A[pos];
    else
      sum -= A[pos];
    C.emplace_back(sum);
  }
  sum = 0;
  for (int i = 1; i < (1 << r); i++) {
    int code = (i ^ (i >> 1)), pos = __builtin_ctz(i);
    if (((1 << pos) & code) != 0)
      sum += B[pos];
    else
      sum -= B[pos];
    D.emplace_back(sum);
  }
  sort(C.begin(), C.end());
  C.emplace_back(INF);
  sort(D.begin(), D.end());
  D.emplace_back(INF);
  long long ans = 0, M = C.size();
  for (int i = 0; i < M; i++) {
    long long res = upper_bound(D.begin(), D.end(), -C[i]) -
                    lower_bound(D.begin(), D.end(), -C[i]);
    ans += abs(res);
  }
  cout << ans - 1 << endl;
  return 0;
}
