#include <bits/stdc++.h>
using namespace std;
long long n, m, p, t, k, sum, ans[200000];
pair<long long, long long> a[200000];
set<pair<long long, pair<long long, long long> > > s;
pair<int, pair<long long, long long> > P1, P[200000];
bool check(long long k) {
  s.clear();
  t = 0;
  p = n - 1;
  for (int i = m - 1; i > -1 && t <= sum; i--) {
    while (p > -1 && P[p].first >= a[i].first) {
      s.insert(make_pair(P[p].second.first,
                         pair<long long, long long>(P[p].second.second, k)));
      p--;
    }
    if (s.size() == 0) return false;
    P1 = *s.begin();
    s.erase(s.begin());
    t += P1.first;
    ans[a[i].second] = P1.second.first;
    if (P1.second.second > 1) {
      P1.second.second--;
      P1.first = 0;
      s.insert(P1);
    }
  }
  if (t <= sum) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> sum;
  for (int i = 0; i < m; i++) {
    cin >> a[i].first;
    a[i].second = i;
  }
  for (int i = 0; i < n; i++) cin >> P[i].first;
  for (int i = 0; i < n; i++) {
    cin >> P[i].second.first;
    P[i].second.second = i;
  }
  sort(P, P + n);
  sort(a, a + m);
  int l = 0, r = m + 1;
  while (l < r) {
    int mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  if (l > m) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  check(l);
  for (int i = 0; i < m; i++) cout << ans[i] + 1 << " ";
  cout << endl;
}
