#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
bool Max(T1& a, T2 b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T1, typename T2>
bool Min(T1& a, T2 b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T, typename AD>
struct ST {
  vector<T> st;
  vector<AD> lazy;
  int n;
  static T combine(T a, T b) { return min(a, b); }
  static T defaultT() { return 1e18; }
  void add(int i, int sz, AD change) {
    st[i] += change;
    if (sz > 1) {
      lazy[i] += change;
    }
  }
  void init(int _n) {
    n = _n;
    int sz = 1;
    while (sz < n) sz <<= 1;
    st.assign(sz << 1, defaultT());
    lazy.assign(sz, AD());
  }
  void init(T* a, int _n) {
    init(_n);
    _build(1, 0, n - 1, a);
  }
  void _build(int i, int l, int r, T* a) {
    if (l == r) {
      st[i] = a[l];
      return;
    }
    int m = l + r >> 1;
    _build(i << 1, l, m, a);
    _build(i << 1 | 1, m + 1, r, a);
    st[i] = combine(st[i << 1], st[i << 1 | 1]);
  }
  void _push(int i, int l, int m, int r) {
    if (!lazy[i]) return;
    add(i << 1, m - l + 1, lazy[i]);
    add(i << 1 | 1, r - m, lazy[i]);
    lazy[i] = AD();
  }
  T query(int a, int b) { return _query(1, 0, n - 1, a, b); }
  T _query(int i, int l, int r, int a, int b) {
    if (b < l || a > r) return defaultT();
    if (l >= a && r <= b) return st[i];
    int m = l + r >> 1;
    _push(i, l, m, r);
    return combine(_query(i << 1, l, m, a, b),
                   _query(i << 1 | 1, m + 1, r, a, b));
  }
  void update(int a, int b, AD change) { _update(1, 0, n - 1, a, b, change); }
  void _update(int i, int l, int r, int a, int b, AD change) {
    if (l >= a && r <= b) {
      add(i, r - l + 1, change);
      return;
    }
    int m = l + r >> 1;
    _push(i, l, m, r);
    if (a <= m) _update(i << 1, l, m, a, b, change);
    if (b > m) _update(i << 1 | 1, m + 1, r, a, b, change);
    st[i] = combine(st[i << 1], st[i << 1 | 1]);
  }
};
const int N = 100002, inf = 1e9 + 1;
int a[N];
long long sa[N];
pair<int, int> b[N];
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> stk, posstk;
  a[0] = inf;
  for (int i = 1; i <= (n); ++i) cin >> a[i];
  for (int i = 1; i <= (n); ++i) sa[i] = sa[i - 1] + a[i];
  for (int i = 0; i < (m); ++i) cin >> b[i].second;
  for (int i = 0; i < (m); ++i) cin >> b[i].first;
  sort(b, b + m);
  posstk.push_back(0);
  stk.push_back(a[0]);
  for (int i = 1; i <= (n); ++i) {
    while (stk.back() <= a[i]) stk.pop_back(), posstk.pop_back();
    posstk.push_back(i);
    stk.push_back(a[i]);
  }
  ST<long long, long long> st;
  st.init(sa, n + 1);
  int ans = 0;
  for (int i = 0; i < (m); ++i) {
    int cost = b[i].first;
    int cap = b[i].second;
    int pos = upper_bound(stk.begin(), stk.end(), cap, greater<int>()) - 1 -
              stk.begin();
    pos = posstk[pos];
    long long mn = st.query(pos, n);
    if (cost <= mn) {
      ans++;
      st.update(pos, n, -cost);
    }
  }
  cout << ans << '\n';
}
void init() {}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.setf(ios::fixed);
  cout.precision(20);
  init();
  int TC = 1;
  for (int TI = 1; TI <= (TC); ++TI) {
    solve();
  }
  return 0;
}
