#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const long long INF64 = (long long)1e18;
#pragma comment(linker, "/STACK:16777216")
#pragma warning(disable : 4786)
int Set(int N, int pos) { return N = N | (1 << pos); }
int Reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
const int mx = 1 << 29;
long long ans, sum, t, n, k, m, ar[200005], lft[200005], rght[200005];
int dx[] = {0, 1, -1, 0, 0};
int dy[] = {0, 0, 0, 1, -1};
int main() {
  cin >> n >> k;
  n++;
  for (int i = 1; i <= n; i++) scanf("%lld", &ar[i]);
  for (int i = 0; i <= n; i++) {
    lft[i] = 9223372036854775807LL;
    rght[i] = 9223372036854775807LL;
  }
  lft[1] = 0;
  sum = ar[1];
  for (int i = 2; i <= n; i++) {
    if (abs(sum + lft[i - 1]) % 2 == 1) break;
    lft[i] = (sum + lft[i - 1]) / 2;
    sum = ar[i];
  }
  rght[n] = 0;
  sum = ar[n];
  for (int i = n - 1; i >= 1; i--) {
    if (abs(sum + rght[i + 1]) >= 2LL * k) break;
    rght[i] = (sum + rght[i + 1]) * 2;
    sum = ar[i];
  }
  for (int i = 1; i <= n - 1; i++) {
    if (lft[i] == 9223372036854775807LL || rght[i] == 9223372036854775807LL)
      continue;
    if (abs(lft[i] + rght[i]) <= k) ans++;
  }
  if (lft[n] != 0) {
    if (abs(lft[n]) <= k) ans++;
  }
  cout << ans << "\n";
  return 0;
}
