#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const long long INF = 1e17;
int n, k, tot, top;
vector<int> E[N];
int nxt[N];
long long ans;
long long tag[N << 2], max_suf[N << 2], max_s[N << 2], max_p[N << 2], pre[N],
    suf[N], w[N], g[N];
int st[N];
template <typename T>
inline void chkmax(T &x, T y) {
  x = max(x, y);
}
template <typename T>
inline void chkmin(T &x, T y) {
  x = min(x, y);
}
template <typename T>
inline void read(T &x) {
  T f = 1;
  x = 0;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -f;
  for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + c - '0';
  x *= f;
}
inline void addedge(int u, int v) {
  E[u].push_back(v);
  return;
}
inline void pushdown(int now, int l, int r) {
  int mid = l + r >> 1;
  if (tag[now]) {
    tag[now << 1] += tag[now];
    tag[now << 1 | 1] += tag[now];
    max_suf[now << 1] += tag[now];
    max_suf[now << 1 | 1] += tag[now];
    max_s[now << 1] += tag[now];
    max_s[now << 1 | 1] += tag[now];
    tag[now] = 0;
  }
  return;
}
inline long long calc(int now, int l, int r, long long val) {
  if (l == r) return val + max_p[now];
  pushdown(now, l, r);
  int mid = l + r >> 1;
  if (max_suf[now << 1] >= val)
    return min(calc(now << 1, l, mid, val), max_s[now]);
  else
    return min(val + max_p[now << 1], calc(now << 1 | 1, mid + 1, r, val));
}
inline long long solve(int now, int l, int r, long long val) {
  if (l == r) return val + max_p[now] <= k ? l : 0;
  int mid = l + r >> 1;
  pushdown(now, l, r);
  if (val + max_p[now << 1 | 1] <= k)
    return solve(now << 1 | 1, mid + 1, r, val);
  else
    return solve(now << 1, l, mid, val);
}
inline long long query(int now, int l, int r, long long val) {
  if (l == r) return val + max_p[now] <= k ? l : 0;
  int mid = l + r >> 1;
  pushdown(now, l, r);
  if (max_suf[now << 1] >= val) {
    if (max_s[now] <= k)
      return query(now << 1 | 1, mid + 1, r, max_suf[now << 1]);
    else
      return query(now << 1, l, mid, val);
  } else
    return max(solve(now << 1, l, mid, val),
               query(now << 1 | 1, mid + 1, r, val));
}
inline void update(int l, int r, int now) {
  max_suf[now] = max(max_suf[now << 1], max_suf[now << 1 | 1]);
  int mid = l + r >> 1;
  max_s[now] = calc(now << 1 | 1, mid + 1, r, max_suf[now << 1]);
}
inline void build(int now, int l, int r) {
  if (l == r) {
    max_suf[now] = suf[l];
    max_p[now] = -suf[l];
    return;
  }
  int mid = l + r >> 1;
  build(now << 1, l, mid);
  build(now << 1 | 1, mid + 1, r);
  update(l, r, now);
  max_p[now] = min(max_p[now << 1], max_p[now << 1 | 1]);
  return;
}
inline void modify(int now, int l, int r, int ql, int qr, long long val) {
  if (ql > qr) return;
  if (l == ql && r == qr) {
    tag[now] += val;
    max_suf[now] += val;
    max_s[now] += val;
    return;
  }
  pushdown(now, l, r);
  int mid = l + r >> 1;
  if (mid >= qr)
    modify(now << 1, l, mid, ql, qr, val);
  else if (mid + 1 <= ql)
    modify(now << 1 | 1, mid + 1, r, ql, qr, val);
  else {
    modify(now << 1, l, mid, ql, mid, val);
    modify(now << 1 | 1, mid + 1, r, mid + 1, qr, val);
  }
  update(l, r, now);
}
inline void dfs(int x) {
  st[++top] = x;
  if (x != n + 1) {
    modify(1, 1, n, 1, x - 1, -INF);
    modify(1, 1, n, nxt[x] - 1, n, pre[x - 1] - pre[nxt[x] - 1]);
    int l = 1, r = top;
    while (l < r) {
      int mid = l + r >> 1;
      if (pre[x - 1] - pre[st[mid] - 1] <= k)
        r = mid;
      else
        l = mid + 1;
    }
    modify(1, 1, n, st[r - 1], n, INF);
    chkmax(ans, query(1, 1, n, -INF) - x + 1);
    modify(1, 1, n, st[r - 1], n, -INF);
    modify(1, 1, n, 1, x - 1, INF);
  }
  for (auto y : E[x]) dfs(y);
  if (x != n + 1)
    modify(1, 1, n, nxt[x] - 1, n, -(pre[x - 1] - pre[nxt[x] - 1]));
  --top;
}
int main() {
  read(n);
  read(k);
  for (int i = 1; i < n; ++i) read(w[i]);
  w[n] = INF;
  for (int i = 1; i <= n; ++i) {
    read(g[i]);
    pre[i] = pre[i - 1] + g[i] - w[i];
    suf[i] = suf[i - 1] + g[i] - w[i - 1];
  }
  st[top = 0] = n;
  for (int i = n - 1; i >= 0; --i) {
    while (top && pre[st[top]] >= pre[i]) --top;
    nxt[i + 1] = st[top] + 1;
    addedge(st[top] + 1, i + 1);
    st[++top] = i;
  }
  build(1, 1, n);
  top = 0;
  dfs(n + 1);
  printf("%d\n", ans);
  return 0;
}
