#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > h;
vector<pair<int, int> > bg;
vector<pair<int, pair<int, int> > > st;
vector<int> bgsa;
int bgs[100005], s, n, m, i, nr, l, r, mij;
void sw(int pos1, int pos2) {
  pair<int, int> p;
  p = h[pos1];
  h[pos1] = h[pos2];
  h[pos2] = p;
}
void down(int pos) {
  int posm;
  if (2 * pos >= h.size()) return;
  if (pos * 2 + 1 == h.size())
    posm = pos * 2;
  else if (h[pos * 2].first < h[pos * 2 + 1].first)
    posm = pos * 2;
  else
    posm = pos * 2 + 1;
  if (h[pos].first > h[posm].first) {
    sw(pos, posm);
    down(posm);
  }
}
void up(int pos) {
  while (h[pos / 2].first > h[pos].first) {
    sw(pos / 2, pos);
    pos = pos / 2;
  }
}
void add(pair<int, int> p) {
  int pos = h.size();
  h.push_back(p);
  up(pos);
}
void del() {
  sw(1, h.size() - 1);
  h.pop_back();
  down(1);
}
int verify(int d) {
  h.clear();
  h.push_back(make_pair(-2000000000, 0));
  int poss = st.size() - 1;
  int ib, i;
  int prs = 0;
  for (ib = bg.size() - 1; ib >= 0; ib = ib - d) {
    while ((poss >= 0) && (st[poss].first >= bg[ib].first)) {
      add(st[poss].second);
      poss--;
    }
    if (h.size() == 1) return 0;
    prs = prs + h[1].first;
    if (prs > s) return 0;
    for (i = ib; i > max(-1, ib - d); i--) bgs[bg[i].second] = h[1].second;
    del();
  }
  return 1;
}
int main(void) {
  cin >> n >> m >> s;
  for (i = 1; i <= m; i++) {
    cin >> nr;
    bg.push_back(make_pair(nr, i));
  }
  for (i = 1; i <= n; i++) {
    cin >> nr;
    st.push_back(make_pair(nr, make_pair(0, i)));
  }
  for (i = 1; i <= n; i++) {
    cin >> nr;
    st[i - 1].second.first = nr;
  }
  sort(st.begin(), st.end());
  sort(bg.begin(), bg.end());
  l = 1;
  r = 100005;
  while (l <= r) {
    mij = (l + r) / 2;
    if (verify(mij) == 1) {
      bgsa.clear();
      for (i = 1; i <= m; i++) bgsa.push_back(bgs[i]);
      r = mij - 1;
    } else
      l = mij + 1;
  }
  if (bgsa.empty())
    cout << "NO";
  else {
    cout << "YES\n";
    for (i = 0; i < bgsa.size(); i++) cout << bgsa[i] << ' ';
  }
  return 0;
}
