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

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

public class segments_ft implements Runnable {

	public final static int MAX_N = (int) 2e5;

	private Scanner in;
	private PrintWriter out;
	String fname = "segments";

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

	public void solve() {
		int n = in.nextInt();
		myAssert(1 <= n && n <= 1e5, "");
		int m = in.nextInt();
		myAssert(1 <= m && m <= 1e5, "");
		int[][] s = new int[n][2];
		for (int i = 0; i < n; i++) {
			int a = in.nextInt();
			int b = in.nextInt();
			myAssert(Math.abs(a) <= 1e9, "");
			myAssert(Math.abs(b) <= 1e9, "");
			s[i][0] = Math.min(a, b);
			s[i][1] = Math.max(a, b);
		}
		int[] x = new int[m];
		for (int i = 0; i < m; i++) {
			x[i] = in.nextInt();
			myAssert(Math.abs(x[i]) <= 1e9, "");
		}
		int[][] a = new int[2 * n + m][];
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			a[cnt++] = new int[] {s[i][0], 0};
			a[cnt++] = new int[] {s[i][1], 2};
		}
		for (int i = 0; i < m; i++) {
			a[cnt++] = new int[] {x[i], 1, i};
		}
		int[] ans = new int[m];
		Arrays.sort(a, new Comparator<int[]>() {
			public int compare(int[] a, int[] b) {
				if (a[0] == b[0]) {
					return a[1] - b[1];
				}
				return a[0] - b[0];
			}
		});
		int sum = 0;
		for (int[] c : a) {
			if (c[1] == 0) {
				sum++;
			}
			if (c[1] == 2) {
				sum--;
			}
			if (c[1] == 1) {
				ans[c[2]] = sum;
			}
		}
		for (int i : ans) {
			out.print(i + " ");
		}
		out.println();
	}

	public void run() {
		try {
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		} finally {
			out.close();
		}		
	}

	public segments_ft() {
		try {
			in = new Scanner(new File(fname + ".in"));
			out = new PrintWriter(new File(fname + ".out"));
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}


	public static void main(String[] args) {
		Locale.setDefault(Locale.US);
		new Thread(new segments_ft()).start();
	}

}                       