#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
long long fr[N], nr[N];
long long a[N];
long long n, k;
long long INF = 1e15 + 10;
int main() {
  scanf("%I64d%I64d", &n, &k);
  for (int i = 0; i <= n; ++i) {
    scanf("%I64d", &a[i]);
  }
  int r = n;
  for (int i = 1; i <= n; ++i) {
    fr[i] = fr[i - 1] + a[i - 1];
    if (fr[i] & 1) {
      r = i - 1;
      break;
    } else {
      fr[i] >>= 1;
    }
  }
  int l = 0;
  for (int i = n - 1; i >= 0; --i) {
    nr[i] = nr[i + 1] + a[i + 1];
    nr[i] *= 2;
    if (abs(nr[i]) > INF) {
      l = i + 1;
      break;
    }
  }
  int ans = 0;
  for (int i = l; i <= r; ++i) {
    long long tmp = -fr[i] - nr[i];
    if (tmp == 0 && i == n) continue;
    if (abs(tmp) > k) continue;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}
