import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class electro_sm_wrong2 {

	class Filter implements Comparable<Filter> {
		int a, b, id;

		public Filter(int a, int b, int id) {
			this.a = a;
			assert 2 <= a && a <= 200000;
			this.b = b;
			assert 1 <= b && b <= 1000000000;
			this.id = id;
		}

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

	class Prib implements Comparable<Prib> {
		int c, id;

		public Prib(int c, int id) {
			this.c = c;
			this.id = id;
			assert 1 <= c && c <= 1000000000;
		}

		@Override
		public int compareTo(Prib o) {
			return  -c + o.c;
		}
		
		@Override
		public String toString() {
			return c + " " + id;
		}
	}

	void solve() throws IOException {
		int k = nextInt();
		assert 1 <= k && k <= 100000;
		Filter[] f = new Filter[k];
		for (int i = 0; i < f.length; i++) {
			f[i] = new Filter(nextInt(), nextInt(), i);
		}
		int n = nextInt();
		assert 1 <= n && n <= 100000;
		Prib[] c = new Prib[n];
		for (int i = 0; i < c.length; i++) {
			c[i] = new Prib(nextInt(), i);
		}

		Arrays.sort(f);
		Arrays.sort(c);
		int[] ansf = new int[k];
		Arrays.fill(ansf, -2);
		int[] ansc = new int[n];
		Arrays.fill(ansc, -2);
		int j = 0;
		int prev = -1;
		int maxpow = Integer.MAX_VALUE;
		for (int i = 0; i < f.length; i++) {
			ansf[f[i].id] = prev;
			int r = f[i].a - 1;
			maxpow = Math.min(maxpow, f[i].b);
			while (j < c.length && r > 0) {				
				ansc[c[j].id] = f[i].id;
				maxpow -= c[j].c;
				j++;
				r--;
			}
			if (j == c.length - 1){
				ansc[c[j].id] = f[i].id;
				maxpow -= c[j].c;
				j++;
				break;
			}
			prev = f[i].id;
		}
		if (j != c.length || maxpow < 0) {
			out.println("No");
			return;
		}
		out.println("Yes");
		for (int i = 0; i < ansf.length; i++) {
			out.print((ansf[i]+1) + " ");
		}
		out.println();
		for (int i = 0; i < ansc.length; i++) {
			out.print((ansc[i]+1) + " ");
		}
		out.println();

	}

	int nextInt() {
		try {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return Integer.parseInt(st.nextToken());
		} catch (IOException e) {
			throw new AssertionError();
		}
	}

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;

	public void run() {
		try {
			br = new BufferedReader(new FileReader("electro.in"));
			out = new PrintWriter(new FileWriter("electro.out"));
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public static void main(String[] args) {
		new electro_sm_wrong2().run();
	}
}
