#include <bits/stdc++.h>
using namespace std;
long long a[100005], b[100005];
const long long inf = 0x3f3f3f3f3f3f3f3f;
void read(long long &x) {
  char c;
  while (!isdigit(c = getchar()))
    ;
  x = 0;
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
}
bool chkmax(long long &a, long long b) { return a < b ? a = b, 1 : 0; }
long long stk[100005], id[100005], tp;
long long f[100005], g[100005];
struct smt {
  long long mx, mx1;
  long long tag;
  long long ls, rs;
  smt *l, *r;
  smt(long long la, long long ra) {
    ls = la;
    rs = ra;
    mx = mx1 = -inf;
    tag = 0;
    if (ls == rs) {
      l = r = 0;
      return;
    }
    long long mid = (ls + rs) >> 1;
    l = new smt(ls, mid);
    r = new smt(mid + 1, rs);
  }
  void set(long long x, long long y) {
    chkmax(mx, y);
    chkmax(mx1, y);
    if (ls == rs) return;
    x <= l->rs ? l->set(x, y) : r->set(x, y);
  }
  void put_tag(long long x) {
    tag += x;
    mx1 += x;
  }
  void push_down() {
    if (tag) {
      l->put_tag(tag);
      r->put_tag(tag);
      tag = 0;
    }
  }
  void add(long long la, long long ra, long long w) {
    if (la <= ls && rs <= ra) {
      tag += w;
      mx1 += w;
      return;
    }
    push_down();
    if (la <= l->rs) l->add(la, ra, w);
    if (r->ls <= ra) r->add(la, ra, w);
    mx1 = max(l->mx1, r->mx1);
  }
  long long query(long long mxr, long long pmx, long long w) {
    if (mxr < ls) return -inf;
    if (ls == rs) return ls;
    push_down();
    if (pmx <= r->mx + w && l->mx1 <= r->mx + w) {
      long long ret = r->query(mxr, max(pmx, l->mx1), w);
      if (ret != -inf) return ret;
    }
    if (pmx <= l->mx + w) {
      long long ret = l->query(mxr, pmx, w);
      if (ret != -inf) return ret;
    }
    return -inf;
  }
};
smt *rt;
signed main() {
  long long n, k;
  read(n);
  read(k);
  for (long long i = 1; i < n; ++i) read(a[i]);
  for (long long i = 1; i <= n; ++i) read(b[i]);
  for (long long i = 1; i <= n; ++i) {
    f[i] = f[i - 1] + b[i - 1] - a[i - 1];
    g[i] = g[i - 1] + b[i] - a[i - 1];
  }
  rt = new smt(1, n);
  long long ans = 0;
  id[0] = n + 1;
  for (long long i = n; i; --i) {
    rt->set(i, g[i]);
    while (tp && stk[tp] >= f[i]) {
      if (tp > 1) {
        rt->add(id[tp - 1] - 1, n, stk[tp - 1] - stk[tp]);
      }
      --tp;
    }
    if (tp) {
      rt->add(id[tp] - 1, n, f[i] - stk[tp]);
    }
    stk[++tp] = f[i];
    id[tp] = i;
    long long l = 1, r = tp, mid;
    while (l <= r) {
      mid = (l + r) >> 1;
      if (f[i] - stk[mid] <= k)
        r = mid - 1;
      else
        l = mid + 1;
    }
    long long w = 0;
    chkmax(ans, rt->query(id[r] - 1, -inf, k) - i + 1);
  }
  printf("%lld\n", ans);
  return 0;
}
