#include <bits/stdc++.h>
using namespace std;
long long pre[100010], suf[100010];
struct Tree {
  long long mnsuf, addsuf;
  long long mnp, addp;
  long long res;
} T[400010];
void pushdown(int root) {
  int lch = root << 1;
  int rch = root << 1 | 1;
  T[lch].mnsuf += T[root].addsuf;
  T[rch].mnsuf += T[root].addsuf;
  T[lch].mnp += T[root].addsuf;
  T[rch].mnp += T[root].addsuf;
  T[lch].addsuf += T[root].addsuf;
  T[rch].addsuf += T[root].addsuf;
  T[lch].mnp += T[root].addp;
  T[rch].mnp += T[root].addp;
  T[lch].addp += T[root].addp;
  T[rch].addp += T[root].addp;
  T[lch].res += T[root].addp;
  T[rch].res += T[root].addp;
  T[root].addsuf = 0;
  T[root].addp = 0;
  return;
}
long long calc(int root, int l, int r, long long val) {
  if (l == r) return T[root].mnp - min(val, T[root].mnsuf);
  pushdown(root);
  int lch = root << 1;
  int rch = root << 1 | 1;
  int mid = (l + r) >> 1;
  long long ans1, ans2;
  if (val < T[lch].mnsuf) {
    ans1 = T[lch].mnp - val;
    ans2 = calc(rch, mid + 1, r, val);
  } else {
    ans1 = calc(lch, l, mid, val);
    ans2 = T[root].res;
  }
  return min(ans1, ans2);
}
void update(int root, int l, int r) {
  int lch = root << 1;
  int rch = root << 1 | 1;
  int mid = (l + r) >> 1;
  T[root].mnsuf = min(T[lch].mnsuf, T[rch].mnsuf);
  T[root].mnp = min(T[lch].mnp, T[rch].mnp);
  T[root].res = calc(rch, mid + 1, r, T[lch].mnsuf);
  return;
}
void build(int root, int l, int r) {
  if (l == r) {
    T[root].mnsuf = suf[l];
    T[root].mnp = suf[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(root << 1, l, mid);
  build(root << 1 | 1, mid + 1, r);
  update(root, l, r);
  return;
}
void change_suf(int root, int l, int r, int x, int y, long long add) {
  if (x > y) return;
  if (x <= l && r <= y) {
    T[root].mnsuf += add;
    T[root].mnp += add;
    T[root].addsuf += add;
    return;
  }
  pushdown(root);
  int mid = (l + r) >> 1;
  if (x <= mid) change_suf(root << 1, l, mid, x, y, add);
  if (y > mid) change_suf(root << 1 | 1, mid + 1, r, x, y, add);
  update(root, l, r);
  return;
}
void change_p(int root, int l, int r, int x, int y, long long add) {
  if (x > y) return;
  if (x <= l && r <= y) {
    T[root].mnp += add;
    T[root].addp += add;
    T[root].res += add;
    return;
  }
  pushdown(root);
  int mid = (l + r) >> 1;
  if (x <= mid) change_p(root << 1, l, mid, x, y, add);
  if (y > mid) change_p(root << 1 | 1, mid + 1, r, x, y, add);
  update(root, l, r);
  return;
}
long long query(int root, int l, int r, int x, int y) {
  if (x <= l && r <= y) return T[root].mnsuf;
  int mid = (l + r) >> 1;
  long long ans = 1e18;
  pushdown(root);
  if (x <= mid) ans = min(ans, query(root << 1, l, mid, x, y));
  if (y > mid) ans = min(ans, query(root << 1 | 1, mid + 1, r, x, y));
  return ans;
}
int n, k;
int solve(int root, int l, int r, int x, int y, long long val) {
  if (l == r) {
    if (T[root].mnp - min(val, T[root].mnsuf) <= k) return l;
    return 0;
  }
  int mid = (l + r) >> 1;
  pushdown(root);
  if (x <= l && r <= y) {
    if (calc(root << 1 | 1, mid + 1, r, min(val, T[root << 1].mnsuf)) <= k)
      return solve(root << 1 | 1, mid + 1, r, x, y,
                   min(val, T[root << 1].mnsuf));
    if (calc(root << 1, l, mid, val) <= k)
      return solve(root << 1, l, mid, x, y, val);
    return 0;
  }
  if (y <= mid) return solve(root << 1, l, mid, x, y, val);
  if (x > mid) return solve(root << 1 | 1, mid + 1, r, x, y, val);
  long long mns = query(root << 1, l, mid, x, y);
  int ans = solve(root << 1 | 1, mid + 1, r, x, y, min(val, mns));
  if (!ans) ans = solve(root << 1, l, mid, x, y, val);
  return ans;
}
struct Edge {
  int v, nxt;
} e[100010];
int tot;
int first[100010];
void adde(int u, int v) {
  e[++tot] = (Edge){v, first[u]};
  first[u] = tot;
  return;
}
int nxt[100010];
int w[100010];
int g[100010];
int sta[100010], head;
void init() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i < n; i++) scanf("%d", &w[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &g[i]);
  for (int i = 2; i <= n; i++) pre[i] = pre[i - 1] - w[i - 1] + g[i - 1];
  for (int i = n - 1; i >= 1; i--) suf[i] = suf[i + 1] - w[i] + g[i + 1];
  pre[n + 1] = -1e18;
  nxt[n + 1] = n + 1;
  head = 1;
  sta[head] = n + 1;
  for (int i = n; i >= 1; i--) {
    while (pre[sta[head]] >= pre[i]) head--;
    nxt[i] = sta[head];
    sta[++head] = i;
    adde(nxt[i], i);
  }
  build(1, 1, n);
  head = 0;
  return;
}
int final_ans;
int tmp[100010];
void dfs(int u) {
  sta[++head] = u;
  if (nxt[u] <= n) {
    change_suf(1, 1, n, 1, nxt[u] - 2, pre[u] - pre[nxt[u]]);
    change_p(1, 1, n, nxt[u] - 1, n, pre[u] - pre[nxt[u]]);
  }
  tmp[u] = tmp[nxt[u]];
  if (!tmp[u]) tmp[u] = 1;
  while (pre[u] - pre[sta[tmp[u]]] > k) tmp[u]++;
  if (u <= n) {
    change_suf(1, 1, n, sta[tmp[u] - 1] - 1, sta[tmp[u] - 1] - 1,
               pre[sta[tmp[u]]] - pre[sta[tmp[u] - 1]]);
    change_p(1, 1, n, sta[tmp[u] - 1] - 1, sta[tmp[u] - 1] - 1,
             pre[sta[tmp[u] - 1]] - pre[sta[tmp[u]]]);
    final_ans = max(final_ans, solve(1, 1, n, u, n, 1e18) - u + 1);
    change_p(1, 1, n, sta[tmp[u] - 1] - 1, sta[tmp[u] - 1] - 1,
             pre[sta[tmp[u]]] - pre[sta[tmp[u] - 1]]);
    change_suf(1, 1, n, sta[tmp[u] - 1] - 1, sta[tmp[u] - 1] - 1,
               pre[sta[tmp[u] - 1]] - pre[sta[tmp[u]]]);
  }
  for (int i = first[u]; i; i = e[i].nxt) dfs(e[i].v);
  if (nxt[u] <= n) {
    change_suf(1, 1, n, 1, nxt[u] - 2, pre[nxt[u]] - pre[u]);
    change_p(1, 1, n, nxt[u] - 1, n, pre[nxt[u]] - pre[u]);
  }
  head--;
  return;
}
int main() {
  init();
  dfs(n + 1);
  printf("%d\n", final_ans);
}
