#include <bits/stdc++.h>
using namespace std;
const int inf = (1 << 28) - 1;
int A[200005];
long long Abs(long long x) {
  if (x < 0) return -x;
  return x;
}
long long sum[200005];
int main() {
  int n;
  long long k;
  scanf("%d%lld", &n, &k);
  for (int i = 0; i <= n; ++i) scanf("%d", &A[i]);
  long long t = 0, flag = 0;
  for (int i = 0; i <= n; ++i) {
    t /= 2;
    sum[i] = t;
    t += A[i];
    flag = i;
    if (t % 2) break;
  }
  for (int i = flag + 1; i <= n; ++i) {
    t /= 2;
    sum[i] = t;
    t += A[i];
  }
  int ans = 0;
  t = 0;
  for (int i = n; i >= 0; --i) {
    t *= 2;
    if (Abs(t + sum[i]) <= k && i <= flag) ans++;
    t += A[i];
    if (Abs(t) >= k) break;
  }
  t = 0;
  for (int i = 0; i <= n - 1; ++i) {
    t /= 2;
    t += A[i];
  }
  if (!t && n == flag) ans--;
  printf("%d\n", ans);
  return 0;
}
