#include <bits/stdc++.h>
const long long Infll = 0x3f3f3f3f3f3f3f3f;
const int MN = 100005, MS = 1 << 18 | 7;
long long K, W[MN], G[MN], pre[MN], suf[MN];
int N, nxt[MN], Ans;
std::vector<int> T[MN];
long long amn[MS], bmn[MS], ans[MS], tg[MS];
inline void P(int i, long long x) { bmn[i] += x, ans[i] -= x, tg[i] += x; }
inline void Pushdown(int i) {
  if (tg[i]) P((i << 1), tg[i]), P(((i << 1) | 1), tg[i]), tg[i] = 0;
}
long long Calc(int i, int l, int r, long long p) {
  if (l == r) return amn[i] - p;
  Pushdown(i);
  if (bmn[(i << 1)] < p)
    return std::min(Calc((i << 1), l, ((l + r) >> 1), p), ans[i]);
  else
    return std::min(amn[(i << 1)] - p,
                    Calc(((i << 1) | 1), ((l + r) >> 1) + 1, r, p));
}
void Build(int i, int l, int r) {
  if (l == r) {
    amn[i] = bmn[i] = suf[l];
    return;
  }
  Build((i << 1), l, ((l + r) >> 1)),
      Build(((i << 1) | 1), ((l + r) >> 1) + 1, r);
  amn[i] = std::min(amn[(i << 1)], amn[((i << 1) | 1)]);
  bmn[i] = std::min(bmn[(i << 1)], bmn[((i << 1) | 1)]);
  ans[i] = Calc(((i << 1) | 1), ((l + r) >> 1) + 1, r, bmn[(i << 1)]);
}
void Mdf(int i, int l, int r, int a, int b, long long x) {
  if (r < a || b < l) return;
  if (a <= l && r <= b) return P(i, x);
  Pushdown(i), Mdf((i << 1), l, ((l + r) >> 1), a, b, x),
      Mdf(((i << 1) | 1), ((l + r) >> 1) + 1, r, a, b, x);
  bmn[i] = std::min(bmn[(i << 1)], bmn[((i << 1) | 1)]);
  ans[i] = Calc(((i << 1) | 1), ((l + r) >> 1) + 1, r, bmn[(i << 1)]);
}
int Solve2(int i, int l, int r, long long v) {
  if (l == r) return l;
  return amn[((i << 1) | 1)] <= v
             ? Solve2(((i << 1) | 1), ((l + r) >> 1) + 1, r, v)
             : Solve2((i << 1), l, ((l + r) >> 1), v);
}
int Solve(int i, int l, int r, long long p) {
  if (l == r) {
    int ret = amn[i] - p <= K ? l : 0;
    p = std::min(p, bmn[i]);
    return ret;
  }
  Pushdown(i);
  if (bmn[(i << 1)] < p) {
    if (ans[i] <= K)
      return Solve(((i << 1) | 1), ((l + r) >> 1) + 1, r, p = bmn[(i << 1)]);
    else {
      int ret = Solve((i << 1), l, ((l + r) >> 1), p);
      p = std::min(p, bmn[i]);
      return ret;
    }
  } else {
    int ret =
        amn[(i << 1)] <= K + p ? Solve2((i << 1), l, ((l + r) >> 1), K + p) : 0;
    return std::max(ret, Solve(((i << 1) | 1), ((l + r) >> 1) + 1, r, p));
  }
}
inline void DFS(int u) {
  static int stk[MN], tp;
  stk[++tp] = u;
  if (nxt[u] <= N) Mdf(1, 1, N, nxt[u] - 1, N, pre[u] - pre[nxt[u]]);
  if (u <= N) {
    int lb = 2, rb = tp - 1, mid, ret = 1;
    while (lb <= rb) {
      mid = (lb + rb) >> 1;
      if (pre[stk[mid]] - pre[u] > K)
        ret = mid, lb = mid + 1;
      else
        rb = mid - 1;
    }
    int rmax = stk[ret] - 1;
    long long _ = Infll;
    if (u > 1) Mdf(1, 1, N, 1, u - 1, Infll);
    Mdf(1, 1, N, rmax, N, -Infll);
    int pos = Solve(1, 1, N, _);
    Mdf(1, 1, N, rmax, N, Infll);
    if (u > 1) Mdf(1, 1, N, 1, u - 1, -Infll);
    Ans = std::max(Ans, pos - u + 1);
  }
  for (auto v : T[u]) DFS(v);
  if (nxt[u] <= N) Mdf(1, 1, N, nxt[u] - 1, N, pre[nxt[u]] - pre[u]);
  --tp;
}
inline void Init() {
  static int stk[MN], tp;
  scanf("%d%lld", &N, &K), Ans = 1;
  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 = 2; i <= N; ++i)
    pre[i] = pre[i - 1] - G[i - 1] + W[i - 1],
    suf[i] = suf[i - 1] - G[i] + W[i - 1];
  pre[N + 1] = Infll, nxt[N + 1] = stk[tp = 1] = N + 1;
  for (int i = N; i >= 1; --i) {
    while (pre[stk[tp]] <= pre[i]) --tp;
    nxt[i] = stk[tp], stk[++tp] = i;
    T[nxt[i]].push_back(i);
  }
}
int main() {
  Init();
  Build(1, 1, N);
  DFS(N + 1);
  printf("%d\n", Ans);
  return 0;
}
