#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int s = 0, t = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') t = -1;
    c = getchar();
  }
  while (isdigit(c)) s = s * 10 + c - 48, c = getchar();
  return s * t;
}
const int N = 1e5 + 5;
const long long inf = 1e15;
inline void Max(int &x, int v) {
  if (v > x) x = v;
}
struct node {
  long long mx, mn, rs, f;
} A[N << 2];
struct edge {
  int to, nxt;
  long long v;
} e[N];
int head[N], cnt = 0;
inline void add(int x, int y, long long v) {
  e[++cnt].to = y, e[cnt].nxt = head[x], e[cnt].v = v, head[x] = cnt;
}
long long p1[N], p2[N], g[N], w[N], f[N], h[N];
int ans = 0, n, K, fa[N], st[N], nxt[N], top = 0;
inline void dfs(int x) {
  for (register int i = head[x]; i; i = e[i].nxt)
    fa[e[i].to] = x, f[e[i].to] = e[i].v, dfs(e[i].to);
}
int ql, qr;
long long d;
inline void Add(int x, long long d) { A[x].mx += d, A[x].rs += d, A[x].f += d; }
inline void down(int k) {
  Add(k << 1, A[k].f), Add(k << 1 | 1, A[k].f), A[k].f = 0;
}
inline long long cal(int l, int r, int k, long long y) {
  if (l == r) return A[k].mn + max(y, A[k].mx - h[l]);
  if (y >= A[k].mx) return A[k].mn + y;
  int mid = (l + r) >> 1;
  down(k);
  if (A[k << 1].mx >= y)
    return min(A[k].rs, cal(l, mid, k << 1, y));
  else
    return min(cal(l, mid, k << 1, y), cal(mid + 1, r, k << 1 | 1, y));
}
inline void up(int k, int l, int r) {
  A[k].mx = max(A[k << 1].mx, A[k << 1 | 1].mx);
  int mid = (l + r) >> 1;
  A[k].rs = cal(mid + 1, r, k << 1 | 1, A[k << 1].mx);
}
inline void build(int l, int r, int k) {
  if (l == r) {
    A[k].mx = p2[l], A[k].mn = -p2[l], A[k].rs = inf;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, k << 1), build(mid + 1, r, k << 1 | 1), up(k, l, r);
  A[k].mn = min(A[k << 1].mn, A[k << 1 | 1].mn);
}
inline void upd(int l, int r, int k) {
  if (ql <= l && r <= qr) {
    Add(k, d);
    return;
  }
  int mid = (l + r) >> 1;
  down(k);
  if (ql <= mid) upd(l, mid, k << 1);
  if (qr > mid) upd(mid + 1, r, k << 1 | 1);
  up(k, l, r);
}
inline long long Q(int l, int r, int k) {
  if (ql > qr || qr < l || r < ql) return -inf;
  if (ql <= l && r <= qr) return A[k].mx;
  int mid = (l + r) >> 1;
  down(k);
  if (qr <= mid) return Q(l, mid, k << 1);
  if (ql > mid) return Q(mid + 1, r, k << 1 | 1);
  return max(Q(l, mid, k << 1), Q(mid + 1, r, k << 1 | 1));
}
inline int query(int l, int r, int k, long long y) {
  int mid = (l + r) >> 1;
  if (ql <= l && r <= qr) {
    if (cal(l, r, k, y) > K) return 0;
    if (l == r) return r;
    down(k);
    int t = query(mid + 1, r, k << 1 | 1, max(y, A[k << 1].mx));
    if (t) return t;
    return query(l, mid, k << 1, y);
  } else {
    down(k);
    if (qr > mid) {
      int t = query(mid + 1, r, k << 1 | 1, max(y, Q(l, mid, k << 1)));
      if (t) return t;
    }
    if (ql <= mid) {
      return query(l, mid, k << 1, y);
    }
  }
}
inline void solve(int x) {
  if (f[x]) ql = fa[x] - 1, qr = n, d = f[x], upd(1, n, 1), h[ql] += d;
  if (x != n + 1) {
    ql = x, qr = n;
    Max(ans, query(1, n, 1, -inf) - x + 1);
  }
  for (register int i = head[x]; i; i = e[i].nxt) solve(e[i].to);
  if (f[x]) ql = fa[x] - 1, qr = n, d = -f[x], upd(1, n, 1), h[ql] += d;
}
int main() {
  n = read(), K = read();
  for (register int i = 1; i <= n - 1; i++) w[i] = read();
  w[n] = -inf;
  for (register int i = 1; i <= n; i++) g[i] = read();
  for (register int i = 1; i <= n; i++) p1[i] = p1[i - 1] + g[i] - w[i];
  for (register int i = 1; i <= n; i++) p2[i] = p2[i - 1] + g[i] - w[i - 1];
  st[top = 1] = 0;
  for (register int i = 1; i <= n - 1; i++) {
    while (top && p1[i] < p1[st[top]])
      add(i + 1, st[top--] + 1, p1[st[top]] - p1[i]);
    st[++top] = i;
  }
  for (register int i = 1; i <= top; i++) add(n + 1, st[i] + 1, 0);
  dfs(n + 1);
  fa[n + 1] = n + 1;
  build(1, n, 1);
  solve(n + 1);
  cout << ans << endl;
  return 0;
}
