#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const long long OO = 0x3f3f3f3f3f3f3f3fLL;
const int maxn = 100000;
int n, K;
int a[maxn + 5], b[maxn + 5];
long long p0[maxn + 5], p1[maxn + 5];
struct node {
  long long Maxv, Mind, Maxp, Maxcost;
  long long label;
  node *c[2];
  node() : Maxv(-OO), Mind(0), Maxp(-OO), Maxcost(0) { memset(c, 0, sizeof c); }
  void update() {
    Maxv = Maxp = -OO;
    Maxcost = 0;
    for (int i = (0), _end_ = (2); i < _end_; ++i)
      if (c[i])
        chkmax(Maxv, c[i]->Maxv), chkmax(Maxp, c[i]->Maxp),
            chkmax(Maxcost, c[i]->Maxcost);
  }
  void flag_label(long long _label) {
    label += _label;
    Maxv += _label;
    Mind += _label;
    Maxcost += _label;
  }
  void push_down() {
    if (label) {
      for (int i = (0), _end_ = (2); i < _end_; ++i)
        if (c[i]) c[i]->flag_label(label);
      label = 0;
    }
  }
};
node nd[(maxn << 1) + 5];
int cur = 0;
node *rt;
inline node *newnode() { return nd + (cur++); }
int seg_x, seg_y;
long long seg_z;
long long seg_Max;
int seg_ret;
long long qmind_ret;
void qmind(node *rt) {
  if (!rt) return;
  if (!rt->c[0] && !rt->c[1])
    chkmin(qmind_ret, seg_Max - rt->Maxp);
  else {
    if (rt->c[0]->Maxv >= seg_Max)
      chkmin(qmind_ret, rt->c[1]->Mind), qmind(rt->c[0]);
    else
      chkmin(qmind_ret, seg_Max - rt->c[0]->Maxp), qmind(rt->c[1]);
  }
}
inline void updmd(node *rt) {
  seg_Max = rt->c[0]->Maxv, qmind_ret = OO;
  qmind(rt->c[1]);
  rt->c[1]->Mind = qmind_ret;
}
void build(node *&rt, int l, int r) {
  rt = newnode();
  if (r - l <= 1) {
    rt->Maxv = rt->Maxp = p1[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(rt->c[0], l, mid);
  build(rt->c[1], mid, r);
  rt->update();
  updmd(rt);
}
void add(node *rt, int l, int r) {
  if (!rt) return;
  if (seg_x <= l && r <= seg_y) {
    rt->flag_label(seg_z);
    return;
  }
  rt->push_down();
  int mid = (l + r) >> 1;
  if (seg_x < mid) add(rt->c[0], l, mid);
  if (seg_y > mid) add(rt->c[1], mid, r);
  rt->update();
  updmd(rt);
}
long long qmax_ret;
void qmax(node *rt, int l, int r) {
  if (!rt) return;
  if (seg_x <= l && r <= seg_y) {
    chkmax(qmax_ret, rt->Maxv);
    return;
  }
  rt->push_down();
  int mid = (l + r) >> 1;
  if (seg_x < mid) qmax(rt->c[0], l, mid);
  if (seg_y > mid) qmax(rt->c[1], mid, r);
}
void query(node *rt, int l, int r) {
  if (!rt) return;
  if (seg_x <= l && r <= seg_y) {
    qmind_ret = OO;
    qmind(rt);
    if (qmind_ret > K) return;
    chkmax(seg_ret, l);
  }
  rt->push_down();
  int mid = (l + r) >> 1;
  if (seg_y > mid) {
    long long tmp = seg_Max;
    qmax_ret = -OO;
    qmax(rt->c[0], l, mid);
    chkmax(seg_Max, qmax_ret);
    query(rt->c[1], mid, r);
    seg_Max = tmp;
  }
  if (seg_ret < mid && seg_x < mid) query(rt->c[0], l, mid);
}
int find_ret = 0;
void find(node *rt, int l, int r) {
  if (!rt) return;
  if (r - l <= 1) return;
  rt->push_down();
  int mid = (l + r) >> 1;
  if (rt->c[0]->Maxcost > K)
    find(rt->c[0], l, mid);
  else
    find_ret = mid, find(rt->c[1], mid, r);
}
vector<int> chd[maxn + 5];
int fa[maxn + 5];
int ans = 0;
void dfs(int first) {
  if (~fa[first])
    seg_x = fa[first] - 1, seg_y = n, seg_z = p0[first] - p0[fa[first]],
    add(rt, 0, n);
  find_ret = 0;
  find(rt, 0, n);
  seg_x = first, seg_y = find_ret + 1, seg_Max = -OO, seg_ret = first;
  query(rt, 0, n);
  chkmax(ans, seg_ret - first + 1);
  for (auto second : chd[first]) dfs(second);
  if (~fa[first])
    seg_x = fa[first] - 1, seg_y = n, seg_z = p0[fa[first]] - p0[first],
    add(rt, 0, n);
}
int main() {
  scanf("%d%d", &n, &K);
  for (int i = (0), _end_ = (n - 1); i < _end_; ++i) scanf("%d", a + i);
  a[n - 1] = 0;
  for (int i = (0), _end_ = (n); i < _end_; ++i) scanf("%d", b + i);
  p0[0] = p1[0] = 0;
  for (int i = (0), _end_ = (n - 1); i < _end_; ++i)
    p0[i + 1] = p0[i] + b[i] - a[i], p1[i + 1] = p1[i] + b[i + 1] - a[i];
  static int stk[maxn + 5];
  int tot = 0;
  for (int i = n - 1; i >= 0; --i) {
    while (tot && p0[stk[tot - 1]] >= p0[i]) --tot;
    if (tot)
      chd[stk[tot - 1]].push_back(i), fa[i] = stk[tot - 1];
    else
      fa[i] = -1;
    stk[tot++] = i;
  }
  build(rt, 0, n);
  for (int i = (0), _end_ = (n); i < _end_; ++i)
    if (!~fa[i]) dfs(i);
  printf("%d\n", ans);
  return 0;
}
