#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1e9 + 7;
const int maxn = 200000 + 10;
int n;
long long k;
long long a[maxn];
long long pre[maxn], suf[maxn];
int main() {
  scanf("%d%I64d", &n, &k);
  for (int i = 0; i <= n; i++) scanf("%I64d", &a[i]);
  int l = 0, r = n;
  for (int i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] + a[i - 1];
    if (pre[i] % 2) {
      r = i - 1;
      break;
    } else
      pre[i] >>= 1;
  }
  int ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    suf[i] = suf[i + 1] + a[i + 1];
    if (abs(suf[i]) >= k) {
      l = i + 1;
      break;
    }
    suf[i] <<= 1;
  }
  for (int i = l; i <= r; i++)
    if (abs(pre[i] + suf[i]) <= k) ans++;
  if (r == n && !abs(pre[n] + suf[n])) ans--;
  printf("%d\n", ans);
}
