#include <stdio.h>
#include <algorithm>
#define NMAX 100000
#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
using namespace std;
int beg[NMAX]={0}, end1[NMAX]={0};

void main()
{
	int n, m;
	int a, b, i, x, y, l, r, xm;
	FILE *input = fopen("segments.in","rb");
	FILE *output = fopen("segments.out","wb");

	fscanf(input, "%i",&n);
	fscanf(input, "%i",&m);
	
	for (i = 0; i < n; i++) 
	{
		fscanf(input, "%i%i",&x,&y);
		beg[i] = min(x, y);
		end1[i] = max(x, y);
	}
	sort(beg, beg+n);
	sort(end1, end1+n);
	for (i = 0; i < m; i++) 
	{
		fscanf(input, "%i",&x);
		l = -1;
		r = n;
		while (r - l > 1) 
		{
			xm = (l + r) / 2;
			if (beg[xm] <= x) 
			{
				l = xm;
			} 
			else 
			{
				r = xm;
			}
		}
		a = r;
		
		l = -1;
		r = n;
		while (r - l > 1) 
		{
			xm = (l + r) / 2;
			if (end1[xm] < x) 
			{
				l = xm;
			} 
			else 
			{
				r = xm;
			}
		}
		b = l;
		fprintf(output, "%i ",a-b-1);
	}
	
	fclose(input);
	fclose(output);
}
