#include <bits/stdc++.h>
using namespace std;
const long long inf = 1LL << 60;
long long a[200005], b[200005], c[200005];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i <= n; ++i) scanf("%lld", a + i);
  memcpy(b, a, sizeof a);
  int r = n;
  for (int i = 0; i < n; ++i) {
    if (b[i] % 2 == 0) {
      b[i + 1] += b[i] / 2;
    } else {
      r = i;
      break;
    }
  }
  memcpy(c, a, sizeof a);
  int l = 0;
  for (int i = n; i > 0; --i) {
    if (abs(c[i]) < inf) {
      c[i - 1] += c[i] * 2;
    } else {
      l = i;
      break;
    }
  }
  int cnt = 0;
  for (int i = l; i <= r; ++i) {
    if (abs(c[i] + b[i] - 2 * a[i]) <= k) ++cnt;
    if (i == n && b[i] + c[i] - 2 * a[i] == 0) --cnt;
  }
  printf("%d\n", cnt);
  return 0;
}
