#include <bits/stdc++.h>
using namespace std;
const long long oo = 1000000000000000000ll;
const int N = 100100;
int i, j, k, n, m, K, ch, En, ans, nn;
int nt[N], h[N];
long long t, g[N], w[N], need[N], pre[N], suf[N], cost[N], s[N];
struct dd {
  int L, R, k;
} A[N];
struct edge {
  int s, n;
} E[N];
struct cc {
  int pos;
  long long val;
};
struct tree {
  cc ind1, ind2;
  long long ad, cost, mx;
} T[N << 2];
void R(int &x) {
  x = 0;
  ch = getchar();
  while (ch < '0' || '9' < ch) ch = getchar();
  while ('0' <= ch && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
}
void R(long long &x) {
  x = 0;
  ch = getchar();
  while (ch < '0' || '9' < ch) ch = getchar();
  while ('0' <= ch && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
}
void E_add(int x, int F) {
  E[++En].s = x;
  E[En].n = h[F];
  h[F] = En;
}
cc min(cc x, cc y) {
  if (x.val < y.val) return x;
  return y;
}
int max(int x, int y) {
  if (x > y) return x;
  return y;
}
long long max(long long x, long long y) {
  if (x > y) return x;
  return y;
}
void down(int k) {
  if (T[k].ad) {
    T[k << 1].ad += T[k].ad;
    T[k << 1].cost += T[k].ad;
    T[k << 1].mx += T[k].ad;
    T[k << 1 | 1].ad += T[k].ad;
    T[k << 1 | 1].cost += T[k].ad;
    T[k << 1 | 1].mx += T[k].ad;
    T[k].ad = 0;
  }
}
cc calc(int L, int R, int k) {
  if (L == R) {
    cc a;
    a.pos = L;
    if (t == -oo)
      a.val = oo;
    else
      a.val = t + T[k].ind1.val;
    return a;
  }
  int mid = (L + R) >> 1;
  if (t <= T[k << 1].mx) return min(calc(L, mid, k << 1), T[k].ind2);
  cc a;
  a = T[k << 1].ind1;
  a.val += t;
  return min(a, calc(mid + 1, R, k << 1 | 1));
}
void up(int L, int R, int k) {
  T[k].cost = T[k << 1].cost;
  T[k].ind1 = min(T[k << 1].ind1, T[k << 1].ind1);
  T[k].mx = max(T[k << 1].mx, T[k << 1 | 1].mx);
  t = T[k << 1].mx;
  int mid = (L + R) >> 1;
  T[k].ind2 = calc(mid + 1, R, k << 1 | 1);
}
void T_build(int L, int R, int k) {
  if (L == R) {
    T[k].ind1.pos = L;
    T[k].ind1.val = -suf[L];
    T[k].mx = suf[L];
    return;
  }
  int mid = (L + R) >> 1;
  T_build(L, mid, k << 1);
  T_build(mid + 1, R, k << 1 | 1);
  up(L, R, k);
}
void T_add(int L, int R, int l, int r, long long ad, int k) {
  if (L == l && R == r) {
    T[k].ind2.val += ad;
    T[k].ad += ad;
    T[k].cost += ad;
    T[k].mx += ad;
    return;
  }
  int mid = (L + R) >> 1;
  down(k);
  if (r <= mid)
    T_add(L, mid, l, r, ad, k << 1);
  else {
    if (l > mid)
      T_add(mid + 1, R, l, r, ad, k << 1 | 1);
    else
      T_add(L, mid, l, mid, ad, k << 1),
          T_add(mid + 1, R, mid + 1, r, ad, k << 1 | 1);
  }
  up(L, R, k);
}
int T_find(int L, int R, int k) {
  if (L == R) return L;
  int mid = (L + R) >> 1;
  down(k);
  if (T[k << 1 | 1].cost <= K) return T_find(mid + 1, R, k << 1 | 1);
  return T_find(L, mid, k << 1);
}
void T_query(int L, int R, int l, int r, int k) {
  if (L == l && R == r) {
    A[++nn].k = k;
    A[nn].L = L;
    A[nn].R = R;
    return;
  }
  int mid = (L + R) >> 1;
  down(k);
  if (r <= mid)
    T_query(L, mid, l, r, k << 1);
  else {
    if (l > mid)
      T_query(mid + 1, R, l, r, k << 1 | 1);
    else
      T_query(L, mid, l, mid, k << 1),
          T_query(mid + 1, R, mid + 1, r, k << 1 | 1);
  }
}
int T_right(int L, int R, int k) {
  if (L == R) return L;
  down(k);
  long long tt = t;
  int mid = (L + R) >> 1;
  if (T[k << 1].mx > t) t = T[k << 1].mx;
  if (calc(mid + 1, R, k << 1 | 1).val <= K)
    return T_right(mid + 1, R, k << 1 | 1);
  t = tt;
  return T_right(L, mid, k << 1);
}
int get_ans() {
  int i;
  s[0] = -oo;
  for (i = 1; i <= nn; i++) s[i] = max(s[i - 1], T[A[i].k].mx);
  for (i = nn; i; i--) {
    t = s[i - 1];
    if (calc(A[i].L, A[i].R, A[i].k).val <= K)
      return T_right(A[i].L, A[i].R, A[i].k);
  }
  return 0;
}
void dfs(int x) {
  if (nt[x] != n + 1) T_add(1, n, nt[x] - 1, n, need[x], 1);
  int tmp;
  if (T[1].cost > K)
    tmp = 0;
  else
    tmp = T_find(1, n, 1);
  if (tmp == n) tmp = n - 1;
  nn = 0;
  T_query(1, n, x, tmp + 1, 1);
  tmp = get_ans();
  if (tmp - x + 1 > ans) ans = tmp - x + 1;
  for (int k = h[x]; k; k = E[k].n) dfs(E[k].s);
  if (nt[x] != n + 1) T_add(1, n, nt[x] - 1, n, -need[x], 1);
}
int main() {
  R(n);
  R(K);
  ans = 1;
  for (i = 1; i < n; i++) R(w[i]);
  for (i = 1; i <= n; i++) R(g[i]);
  for (i = 1; i < n; i++) pre[i] = pre[i - 1] + g[i] - w[i];
  for (i = 2; i <= n; i++) suf[i] = suf[i - 1] + g[i] - w[i - 1];
  nt[n] = n + 1;
  for (i = n - 1; i; i--) {
    if (pre[i] - pre[i - 1] < 0)
      nt[i] = i + 1;
    else {
      k = nt[i + 1];
      while (k <= n && pre[k - 1] - pre[i - 1] >= 0) k = nt[k];
      nt[i] = k;
    }
    if (nt[i] != n + 1) {
      need[i] = pre[i - 1] - pre[nt[i] - 1];
      E_add(i, nt[i]);
    }
  }
  T_build(1, n, 1);
  for (i = 1; i <= n; i++)
    if (nt[i] == n + 1) dfs(i);
  printf("%d\n", ans);
}
