#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > cnj;
pair<int, int> bs[100100];
pair<int, pair<int, int> > ss[100100];
int rsp[100100];
int n, m, s;
bool pr = false;
bool pode(int days) {
  if ((m + days - 1) / days > n) return false;
  int p = n - 1;
  int tmp = s;
  int k = 0;
  int lst = -1;
  cnj.clear();
  for (int b = m - 1; b >= 0; b--) {
    if (k == 0) {
      while (p >= 0 && ss[p].first >= bs[b].first) {
        cnj.insert(ss[p].second);
        p--;
      }
      if (cnj.size() == 0) return false;
      if ((*cnj.begin()).first > tmp) return false;
      tmp -= (*cnj.begin()).first;
      rsp[bs[b].second] = (lst = (*cnj.begin()).second);
      cnj.erase(cnj.begin());
      k = days - 1;
    } else {
      rsp[bs[b].second] = lst;
      k--;
    }
  }
  return true;
}
int main() {
  scanf("%d %d %d", &n, &m, &s);
  for (int i = 0; i < m; i++) scanf("%d", &bs[i].first), bs[i].second = i;
  sort(bs, bs + m);
  for (int i = 0; i < n; i++) scanf("%d", &ss[i].first);
  for (int i = 0; i < n; i++)
    scanf("%d", &ss[i].second.first), ss[i].second.second = i + 1;
  sort(ss, ss + n);
  int l1 = 1, l2 = 1000000;
  while (l1 < l2) {
    int w = (l1 + l2) / 2;
    if (pode(w))
      l2 = w;
    else
      l1 = w + 1;
  }
  if (!pode(l2))
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i < m; i++) {
      if (i) printf(" ");
      printf("%d", rsp[i]);
    }
    printf("\n");
  }
  return 0;
}
