// Задача "Точки и отрезки"
// 9-ая Интернет-олимпиада сезона 2007-2008, базовый уровень
// Автор задачи: Сергей Поромов, poromov@rain.ifmo.ru
// Автор решения: Сергей Поромов, poromov@rain.ifmo.ru

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

public class segments_sp implements Runnable {

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

	public void run() {
		try {
			solve();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	BufferedReader br;

	PrintWriter out;

	StringTokenizer st;

	String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(br.readLine());
		}
		return st.nextToken();
	}

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

	void myAssert(boolean e, String s) {
		if (!e) {
			throw new Error("Assertion failure " + s);
		}
	}

	private static final String FILENAME = "segments";

	public void solve() throws IOException {
		br = new BufferedReader(new FileReader(FILENAME + ".in"));
		out = new PrintWriter(FILENAME + ".out");
		int n = nextInt();
		int m = nextInt();
		int[] beg = new int[n];
		int[] end = new int[n];
		for (int i = 0; i < n; i++) {
			int x = nextInt();
			int y = nextInt();
			beg[i] = Math.min(x, y);
			end[i] = Math.max(x, y);
		}
		Arrays.sort(beg);
		Arrays.sort(end);
		for (int i = 0; i < m; i++) {
			int x = nextInt();
			int l = -1;
			int r = n;
			while (r - l > 1) {
				int xm = (l + r) / 2;
				if (beg[xm] <= x) {
					l = xm;
				} else {
					r = xm;
				}
			}
			int a = r;
			
			l = -1;
			r = n;
			while (r - l > 1) {
				int xm = (l + r) / 2;
				if (end[xm] < x) {
					l = xm;
				} else {
					r = xm;
				}
			}
			int b = l;
			
			out.print((a - b - 1) + " ");
		}
		out.close();
	}
}
