#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
int ans = 0;
int N, M, B[MAXN], P[MAXN];
long long A[MAXN];
vector<pair<int, int> > V, VV;
struct STN {
  long long x;
  void merge(STN& L, STN& R) { x = min(L.x, R.x); }
  void operator=(long long a) { x = a; }
  void operator+=(long long a) { x += a; }
};
STN ST[4 * MAXN];
long long lazy[4 * MAXN];
void STB(int id = 1, int l = 0, int r = N) {
  if (r - l < 2) {
    ST[id] = A[l];
    return;
  }
  int M = (l + r) >> 1, L = id << 1, R = L | 1;
  STB(L, l, M);
  STB(R, M, r);
  ST[id].merge(ST[L], ST[R]);
}
void upd(int id, int l, int r, long long x) {
  lazy[id] += x;
  ST[id] += x;
}
void shift(int id, int l, int r) {
  int M = (l + r) >> 1, L = id << 1, R = L | 1;
  upd(L, l, M, lazy[id]);
  upd(R, M, r, lazy[id]);
  lazy[id] = 0;
}
void STU(int x, int y, long long v, int id = 1, int l = 0, int r = N) {
  if (x >= r || l >= y) return;
  if (x <= l && r <= y) {
    upd(id, l, r, v);
    return;
  }
  shift(id, l, r);
  int M = (l + r) >> 1, L = id << 1, R = L | 1;
  STU(x, y, v, L, l, M);
  STU(x, y, v, R, M, r);
  ST[id].merge(ST[L], ST[R]);
}
STN STQ(int x, int y, int id = 1, int l = 0, int r = N) {
  if (x == l && y == r) return ST[id];
  shift(id, l, r);
  int M = (l + r) >> 1, L = id << 1, R = L | 1;
  if (x >= M) return STQ(x, y, R, M, r);
  if (y <= M) return STQ(x, y, L, l, M);
  STN res, ln = STQ(x, M, L, l, M), rn = STQ(M, y, R, M, r);
  return res.merge(ln, rn), res;
}
int main() {
  scanf("%d", &N), scanf("%d", &M);
  for (int i = 0; i < (int)N; i++) scanf("%lld", &A[i]);
  for (int i = 0; i < (int)M; i++) {
    int x;
    scanf("%d", &x);
    V.push_back({x, 0});
  }
  for (int i = 0; i < (int)M; i++) {
    int x;
    scanf("%d", &x);
    V[i].second = x;
  }
  sort(V.begin(), V.end());
  int j = 0;
  for (int i = N - 1; i > (int)-1; i--) {
    while (j < M && V[j].first <= A[i]) {
      VV.push_back({V[j++].second, i});
    }
  }
  for (int i = 1; i < (int)N; i++) A[i] += A[i - 1];
  STB();
  sort(VV.begin(), VV.end());
  for (int i = 0; i < (int)VV.size(); i++) {
    int val = VV[i].first;
    int pos = VV[i].second;
    long long mn = STQ(pos, N).x;
    if (val <= mn) {
      ans++;
      STU(pos, N, -val);
    }
  }
  printf("%d\n", ans);
}
