#include <bits/stdc++.h>
int n, s[200010], p;
long long k, w[200010], g[200010], a[200010], b[200010], c[200010], d[200010];
long long inf = 0x3f3f3f3f3f3f3f3fll;
struct node {
  long long x, lz, d;
} tr[800010];
int ans[200010];
void build(int x = 1, int l = 1, int r = n) {
  tr[x].x = -inf;
  if (l == r) return;
  build(x << 1, l, (l + r) >> 1);
  build(x << 1 | 1, ((l + r) >> 1) + 1, r);
}
void pushup(int x, int ls, int rs) {
  tr[x].x = std::max(tr[ls].x, tr[rs].x);
  tr[x].d = std::max(tr[ls].d, tr[rs].d);
}
void addtag(int x, long long lz) {
  tr[x].lz += lz;
  tr[x].x += lz;
}
void pushdown(int x, int ls, int rs) {
  if (tr[x].lz) addtag(ls, tr[x].lz), addtag(rs, tr[x].lz), tr[x].lz = 0;
}
void setx(int p, long long k, int x = 1, int l = 1, int r = n) {
  if (l == r) return tr[x].x = tr[x].d = k, void();
  int mid = (l + r) >> 1, ls = x << 1, rs = x << 1 | 1;
  pushdown(x, ls, rs);
  if (p <= mid)
    setx(p, k, ls, l, mid);
  else
    setx(p, k, rs, mid + 1, r);
  pushup(x, ls, rs);
}
void add(int pl, int pr, long long k, int x = 1, int l = 1, int r = n) {
  if (l == pl && r == pr) return addtag(x, k);
  int mid = (l + r) >> 1, ls = x << 1, rs = x << 1 | 1;
  pushdown(x, ls, rs);
  if (pr <= mid)
    add(pl, pr, k, ls, l, mid);
  else if (pl > mid)
    add(pl, pr, k, rs, mid + 1, r);
  else
    add(pl, mid, k, ls, l, mid), add(mid + 1, pr, k, rs, mid + 1, r);
  pushup(x, ls, rs);
}
int ask(int pl, int pr, long long p, int x = 1, int l = 1, int r = n) {
  if (l == r) return l;
  int mid = (l + r) >> 1, ls = x << 1, rs = x << 1 | 1;
  pushdown(x, ls, rs);
  if (mid < pl) return ask(pl, pr, p, rs, mid + 1, r);
  if (pr <= mid) return ask(pl, pr, p, ls, l, mid);
  if (tr[rs].d + k >= std::max(p, tr[ls].x))
    return ask(pl, pr, std::max(p, tr[ls].x), rs, mid + 1, r);
  return ask(pl, pr, p, ls, l, mid);
}
void dfs(int x = 1, int l = 1, int r = n) {
  printf("%lld %lld %lld %d~%d\n", tr[x].x, tr[x].lz, tr[x].d, l, r);
  if (l == r) return;
  int mid = (l + r) >> 1, ls = x << 1, rs = x << 1 | 1;
  dfs(ls, l, mid), dfs(rs, mid + 1, r);
}
int main() {
  scanf("%d%lld", &n, &k);
  for (int i = 1; i < n; i++) scanf("%lld", w + i);
  for (int i = 1; i <= n; i++) scanf("%lld", g + i);
  for (int i = 1; i < n; i++) a[i] = a[i - 1] + w[i];
  for (int i = 1; i <= n; i++) b[i] = b[i - 1] + g[i];
  for (int i = 1; i <= n; i++) c[i] = a[i - 1] - b[i - 1];
  for (int i = 1; i <= n; i++) d[i] = b[i] - a[i - 1];
  build();
  for (int i = n; i; i--) {
    while (p && c[i] >= c[s[p]]) {
      if (p > 1) add(s[p - 1] - 1, n, c[s[p]] - c[s[p - 1]]);
      --p;
    }
    s[++p] = i, setx(i, d[i]);
    if (p > 1) add(s[p - 1] - 1, n, c[s[p - 1]] - c[i]);
    int l = 1, r = p;
    while (l < r) {
      int mid = (l + r) >> 1;
      if (c[s[mid]] - c[i] <= k)
        r = mid;
      else
        l = mid + 1;
    }
    r = r == 1 ? n : s[r - 1] - 1;
    ans[i] = ask(i, r, -inf);
  }
  int res = 0;
  for (int i = 1; i <= n; i++) res = std::max(res, ans[i] - i + 1);
  printf("%d\n", res);
  return 0;
}
