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

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

public class segments_sp2 implements Runnable {

	public static void main(String[] args) {
		new Thread(new segments_sp2()).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";
	
	class Pair implements Comparable<Pair>{
		int a, b;
		
		Pair(int a, int b) {
			this.a = a;
			this.b = b;
		}

		@Override
		public int compareTo(Pair o) {
			return this.a - o.a;
		}
		
	}

	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);
		Pair[] p = new Pair[m];
		int[] ans = new int[m];
		for (int i = 0; i < m; i++) {
			p[i] = new Pair(nextInt(), i);
		}
		Arrays.sort(p);
		int a = 0;
		int b = 0;
		int h = 0;
		for (int i = 0; i < m; i++) {
			while (a < n && beg[a] <= p[i].a) {
				a++;
				h++;
			}
			while (b < n && end[b] < p[i].a) {
				b++;
				h--;
			}
			ans[p[i].b] = h;
		}
		for (int i = 0; i < m; i++) {
			out.print(ans[i] + " ");
		}
		out.close();
	}
}
