import java.io.*;
import java.util.*;
import java.math.*;

public class electro_aa implements Runnable {

	public static void main(String[] args) {
		new Thread(new electro_aa()).start();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;
	Random rand = new Random(this.hashCode());

	@Override
	public void run() {
		long time = System.currentTimeMillis();
		Locale.setDefault(Locale.US);
		try {
			br = new BufferedReader(new FileReader(FNAME + ".in"));
			out = new PrintWriter(FNAME + ".out");
			solve();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(566);
		}
		System.out.println((System.currentTimeMillis() - time) / 1000.0);
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	void myAssert(boolean u, String message) {
		if (!u) {
			throw new Error("Assertion failed!!! " + message);
		}
	}

	int inBounds(int x, int l, int r, String name) {
		myAssert(l <= x && x <= r, name + " not in bounds!!! " + x
				+ " not in [" + l + ".." + r + "]");
		return x;
	}

	String FNAME = "electro";

	class Filter implements Comparable<Filter> {
		public Filter(int a2, int b2, int i) {
			a = a2;
			b = b2;
			n = i;
			pluged = -1;
		}

		int a, b;
		int n;
		int pluged;

		@Override
		public int compareTo(Filter f) {
			return f.b - b;
		}
	}

	class Device implements Comparable<Device> {
		public Device(int x, int i) {
			c = x;
			n = i;
		}

		int c, n;
		int pluged = -1;

		@Override
		public int compareTo(Device o) {
			return o.c - c;
		}
	}

	private void solve() throws IOException {
		int k = inBounds(nextInt(), 1, 100000, "k");
		Filter[] a = new Filter[k];
		for (int i = 0; i < a.length; i++) {
			a[i] = new Filter(inBounds(nextInt(), 2, 100000, "a[" + (i + 1)
					+ "]"), inBounds(nextInt(), 1, 1000000000, "b[" + (i + 1)
					+ "]"), i);
		}
		Arrays.sort(a);
		int n = inBounds(nextInt(), 1, 100000, "n");
		Device[] b = new Device[n];
		long sum = 0;
		for (int i = 0; i < b.length; i++) {
			b[i] = new Device(inBounds(nextInt(), 1, 1000000000, "c[" + (i + 1)
					+ "]"), i);
			sum += b[i].c;
		}
		if (n == 1) {
			out.println("Yes");
			for (int i = 0; i < a.length; i++) {
				out.print(-1 + " ");
			}
			out.println();
			out.println(0);
			return;
		}
		Arrays.sort(b);
		int j = 0;
		a[j].pluged = 0;
		for (int i = 0; i < b.length; i++) {
			if (a[j].b < sum) {
				out.println("No");
				return;
			}
			while (true) {
				if (a[j].a > 1 || (a[j].a == 1 && i + 1 == b.length)) {
					b[i].pluged = a[j].n + 1;
					a[j].a--;
					sum -= b[i].c;
					break;
				}
				j++;
				if (j == a.length) {
					out.println("No");
					return;
				} else {
					a[j].pluged = a[j - 1].n + 1;
				}
			}
		}
		Arrays.sort(a, new Comparator<Filter>() {

			@Override
			public int compare(Filter o1, Filter o2) {
				return o1.n - o2.n;
			}
		});
		Arrays.sort(b, new Comparator<Device>() {

			@Override
			public int compare(Device o1, Device o2) {
				return o1.n - o2.n;
			}

		});
		out.println("Yes");
		for (int i = 0; i < a.length; i++) {
			out.print(a[i].pluged + " ");
		}
		out.println();
		for (int i = 0; i < b.length; i++) {
			out.print(b[i].pluged + " ");
		}
		out.println();
	}
}
