#include <bits/stdc++.h>
using namespace std;
vector<pair<pair<int, int>, int> > st;
vector<pair<int, int> > b;
int n, m, s;
int ans[100010];
bool test(int d) {
  long long p = 0;
  int pos = n - 1;
  int i = m - 1;
  set<pair<int, int> > a;
  while (i >= 0) {
    while (pos >= 0 and st[pos].first.first >= b[i].first) {
      a.insert(make_pair(st[pos].first.second, st[pos].second));
      pos--;
    }
    int dd = d;
    if (a.empty()) return false;
    p += a.begin()->first;
    while (dd and i >= 0) {
      ans[b[i].second] = a.begin()->second;
      i--;
      dd--;
    }
    a.erase(a.begin());
  }
  if (p > (long long)s) return false;
  return true;
}
int search() {
  int lo = 1, mid, hi = m;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    if (test(mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  if (lo == m and !test(lo)) return -1;
  return lo;
}
int main() {
  scanf("%d %d %d", &n, &m, &s);
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    b.push_back(make_pair(x, i));
  }
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    st.push_back(make_pair(make_pair(x, 0), i));
  }
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    st[i].first.second = x;
  }
  sort(b.begin(), b.end());
  sort(st.begin(), st.end());
  int res = search();
  printf("%s\n", res == -1 ? "NO" : "YES");
  if (res == -1) return 0;
  test(res);
  for (int i = 0; i < m; i++) {
    if (i) printf(" ");
    printf("%d", ans[i] + 1);
  }
  printf("\n");
  return 0;
}
