#include <bits/stdc++.h>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
long long int a[100005], c[100005], b[100005];
vector<pair<long long int, pair<long long int, long long int> > > v;
long long int chec(long long int x, long long int s) {
  priority_queue<long long int> pq;
  long long int s1 = 0, i;
  long long int cn = 0;
  for (i = v.size() - 1; i >= 0; i--) {
    long long int p = v[i].first;
    long long int p1 = v[i].second.first;
    if (p1 != -1) {
      pq.push(-p1);
      continue;
    }
    if (cn == 0) {
      if (pq.size() == 0) return 0;
      s1 += (-pq.top());
      pq.pop();
    }
    cn++;
    if (cn == x) cn = 0;
    if (s1 > s) return 0;
  }
  return 1;
}
int main() {
  long long int n, m, s, i, x;
  while (cin >> m >> n >> s) {
    for (i = 1; i <= n; i++) {
      scanf("%lld", &x);
      v.push_back(make_pair(x, make_pair(-1, i)));
    }
    for (i = 1; i <= m; i++) scanf("%lld", &a[i]);
    for (i = 1; i <= m; i++) {
      scanf("%lld", &c[i]);
      v.push_back(make_pair(a[i], make_pair(c[i], i)));
    }
    sort(v.begin(), v.end());
    long long int lo = 1, hi = 1000000, mid, ans = 0;
    while (lo <= hi) {
      mid = (lo + hi) >> 1;
      long long int p = chec(mid, s);
      if (p == 0)
        lo = mid + 1;
      else {
        ans = mid;
        hi = mid - 1;
      }
    }
    if (ans == 0) {
      cout << "NO" << endl;
      continue;
    }
    long long int an[n + 5];
    priority_queue<pair<long long int, long long int> > pq;
    long long int cn = 0, cn1;
    for (i = v.size() - 1; i >= 0; i--) {
      long long int p = v[i].first;
      long long int p1 = v[i].second.first;
      long long int p2 = v[i].second.second;
      if (p1 != -1) {
        pq.push(make_pair(-p1, p2));
        continue;
      }
      if (cn == 0) {
        cn1 = pq.top().second;
        pq.pop();
      }
      cn++;
      an[p2] = cn1;
      if (cn == ans) cn = 0;
    }
    printf("YES\n");
    for (i = 1; i <= n; i++) printf("%lld ", an[i]);
    cout << endl;
  }
  return 0;
}
