#include <bits/stdc++.h>
using namespace std;
const int MXN = 100005;
struct SegmentTree {
  struct Node {
    long long mxsuf, mnp, mnr, tag;
  } tree[4 * MXN];
  int n;
  long long k;
  int at[MXN];
  void add_tag(int id, long long v) {
    tree[id].mxsuf += v;
    tree[id].mnr += v;
    tree[id].tag += v;
  }
  void push(int id) {
    if (!tree[id].tag) return;
    int lc = id * 2, rc = id * 2 + 1;
    add_tag(lc, tree[id].tag);
    add_tag(rc, tree[id].tag);
    tree[id].tag = 0;
  }
  long long calc(int l, int r, long long mx, int id) {
    if (l == r) return mx + tree[id].mnp;
    push(id);
    int m = (l + r) / 2, lc = id * 2, rc = id * 2 + 1;
    if (mx > tree[lc].mxsuf)
      return min(tree[lc].mnp + mx, calc(m + 1, r, mx, rc));
    return min(calc(l, m, mx, lc), tree[rc].mnr);
  }
  void pull(int l, int r, int id) {
    int m = (l + r) / 2;
    int lc = id * 2;
    int rc = id * 2 + 1;
    tree[id].mxsuf = max(tree[lc].mxsuf, tree[rc].mxsuf);
    tree[id].mnp = min(tree[lc].mnp, tree[rc].mnp);
    tree[id].mnr = calc(m + 1, r, tree[lc].mxsuf, rc);
  }
  void build(int l, int r, int id, long long suf[]) {
    tree[id].tag = 0;
    if (l == r) {
      at[l] = id;
      tree[id].mxsuf = suf[l];
      tree[id].mnp = -suf[l];
      return;
    }
    int m = (l + r) / 2, lc = id * 2, rc = id * 2 + 1;
    build(l, m, lc, suf);
    build(m + 1, r, rc, suf);
    pull(l, r, id);
  }
  void update(int l, int r, int fl, int fr, long long v, int id) {
    if (l == fl and r == fr) {
      add_tag(id, v);
      return;
    }
    push(id);
    int m = (l + r) / 2, lc = id * 2, rc = id * 2 + 1;
    if (fr < m)
      update(l, m, fl, fr, v, lc);
    else if (m < fl)
      update(m + 1, r, fl, fr, v, rc);
    else {
      update(l, m, fl, m, v, lc);
      update(m + 1, r, m + 1, fr, v, rc);
    }
    pull(l, r, id);
  }
  void add_suff(int x, long long v) { update(0, n - 1, x, n - 1, v, 1); }
  long long get_cost(int x) {
    long long ret = 0;
    for (int i = at[x]; i; i = i / 2) ret += tree[i].tag;
    return ret;
  }
  static const long long INF = 1LL << 60;
  long long mx_left;
  int query(int l, int r, int fl, int fr, long long mx, int id) {
    int m = (l + r) / 2, lc = id * 2, rc = id * 2 + 1;
    if (r < fl or fr < l) return 0;
    if (fl <= l and r <= fr) {
      mx_left = max(mx_left, tree[id].mxsuf);
      if (l == r) {
        if (mx + tree[id].mnp <= k)
          return l;
        else
          return 0;
      }
      push(id);
      if (calc(m + 1, r, max(mx, tree[lc].mxsuf), rc) <= k)
        return query(m + 1, r, fl, fr, max(mx, tree[lc].mxsuf), rc);
      return query(l, m, fl, fr, mx, lc);
    }
    push(id);
    int ret = query(l, m, fl, fr, mx, lc);
    ret = max(ret, query(m + 1, r, fl, fr, max(mx, mx_left), rc));
    return ret;
  }
  int query(int l, int r) {
    mx_left = -INF;
    return query(0, n - 1, l, r, -INF, 1);
  }
} tree;
int N;
long long K, W[MXN], G[MXN];
int ans, vst[MXN];
long long pre[MXN], suf[MXN], delta[MXN];
vector<int> child[MXN];
void add_suf(int id, long long v) { tree.add_suff(id, v); }
void calc(int i) {
  long long mx_left = -(1LL << 60);
  int l = i, r = N;
  while (l < r) {
    int m = (l + r) / 2;
    if (tree.get_cost(m) > K)
      r = m;
    else
      l = m + 1;
  }
  r = min(r, N - 1);
  if (r - i + 1 <= ans) return;
  int ret = tree.query(i, r) - i + 1;
  ans = max(ans, ret);
  return;
  for (int j = i; j <= r; j++) {
    if (mx_left - suf[j] + delta[j] <= K) ans = max(ans, j - i + 1);
    mx_left = max(mx_left, suf[j]);
    if (delta[j] > K) {
      break;
    }
  }
}
void DFS(int u, int f) {
  vst[u] = 1;
  if (f != -1) {
    add_suf(f - 1, pre[u] - pre[f]);
  }
  calc(u);
  for (auto v : child[u]) {
    DFS(v, u);
  }
  if (f != -1) {
    add_suf(f - 1, pre[f] - pre[u]);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> N >> K;
  for (int i = 0; i < (N - 1); i++) cin >> W[i];
  for (int i = 0; i < (N); i++) cin >> G[i];
  pre[0] = suf[0] = 0;
  for (int i = 0; i < (N); i++) {
    pre[i + 1] = pre[i] + G[i] - W[i];
    suf[i + 1] = suf[i] + G[i + 1] - W[i];
  }
  vector<int> stk;
  for (int i = N - 1; i >= 0; i--) {
    while (!stk.empty() and pre[stk.back()] >= pre[i]) stk.pop_back();
    if (!stk.empty()) {
      child[stk.back()].push_back(i);
    }
    stk.push_back(i);
  }
  tree.n = N;
  tree.k = K;
  ans = 0;
  tree.build(0, N - 1, 1, suf);
  for (int i = N - 1; i >= 0; i--) {
    if (!vst[i]) {
      DFS(i, -1);
    }
  }
  cout << ans << endl;
  return 0;
}
