#include <cstdio>
#include <set>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long llint;

const int MAXN = 200100;

struct event {
	llint a,b,velicina,tip,in1,in2;

	event(){}

	event(llint x,llint y, llint z,llint i1,llint i2) {
		a = x;
		b = y;
		velicina = b - a + 1;
		tip = z;
		in1 = i1;
		in2 = i2;
	}

	friend bool operator < (event a,event b) {
		if (a.a != b.a) return a.a < b.a;
		if (a.tip != b.tip) return a.tip < b.tip;
		return a.in1 < a.in2;
	}
};

set <pair <llint,llint> > s;
set <pair <llint,llint> >::iterator it;

vector <event> v;

llint n,m;
llint a,b;

int main()  {
	scanf("%I64d %I64d",&n,&m);

	llint preva, prevb;

	for (llint i = 0; i < n; i++) {
		scanf("%I64d %I64d",&a,&b);
		if (i == 0) {
			preva = a;
			prevb = b;
			continue;
		}

		v.push_back(event(a - prevb, b - preva, -1, i - 1, i));
		v.push_back(event(b - preva, a - prevb, 4, i - 1, i));
		preva = a;
		prevb = b;
	}

	for (llint i = 0; i < m; i++) {
		scanf("%I64d",&a);
		v.push_back(event(a,a, 1, i + 1, -1));
	}

	sort(v.begin(),v.end());
	llint sol[MAXN];

	for (llint i = 0; i < (llint)v.size(); i++) {
		event x = v[i];

		if (x.tip == 1) {
			if ((int)s.size() == 0) continue;
			it = s.begin();

			sol[it -> second] = x.in1;
			s.erase(it);
		}
		else if (x.tip == -1) {
			s.insert(make_pair(x.velicina,x.in1));
		}
		else {
			if ((int)s.size() != 0 && s.find(make_pair(x.a - x.b + 1, x.in1)) != s.end()) {
				printf("No\n");
				return 0;
			}
		}
	}

	printf("Yes\n");

	for (llint i = 0; i < n - 1; i++)
		printf("%I64d ",sol[i]);
	printf("\n");
	return 0;
}


#include <cstdio>
#include <set>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long llint;

const int MAXN = 200100;

struct event {
	llint a,b,velicina,tip,in1,in2;

	event(){}

	event(llint x,llint y, llint z,llint i1,llint i2) {
		a = x;
		b = y;
		velicina = b - a + 1;
		tip = z;
		in1 = i1;
		in2 = i2;
	}

	friend bool operator < (event a,event b) {
		if (a.a != b.a) return a.a < b.a;
		if (a.velicina != b.velicina) return a.velicina < b.velicina;
		return a.in1 < b.in1;
	}
};

set <pair <llint,llint> > s;
set <pair <llint,llint> >::iterator it;

vector <event> v;

llint n,m;
llint a,b;

int main()  {
	scanf("%I64d %I64d",&n,&m);

	llint preva, prevb;

	if (n - 1 > m) {
		printf("No\n");
		return 0;
	}

	for (llint i = 0; i < n; i++) {
		scanf("%I64d %I64d",&a,&b);
		if (i == 0) {
			preva = a;
			prevb = b;
			continue;
		}

		v.push_back(event(a - prevb, b - preva, -1, i - 1, i));
		preva = a;
		prevb = b;
	}

	sort(v.begin(),v.end());

	for (llint i = 0; i <m; i++) {
    	scanf("%I64d",&a);
    	s.insert(make_pair(a,i));
    }

    llint sol[MAXN];

    for (llint i = 0; i < (llint)v.size(); i++) {
    	event x = v[i];

    	if ((int)s.size() == 0) {
    		printf("No\n");
    		return 0;
    	}
    	it = s.upper_bound(make_pair(x.b,0));

    	if (it != s.begin()) it--;

    	if (it -> first > x.b || it -> first < x.a) {
    		printf("No\n");
    		return 0;
    	}

    	sol[x.in1] = it -> second + 1;
    	s.erase(it);
    }

	printf("Yes\n");

	for (llint i = 0; i < n - 1; i++)
		printf("%I64d ",sol[i]);
	printf("\n");
	return 0;
}


#include <cstdio>
#include <set>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long llint;

const int MAXN = 200100;

struct event {
	llint a,b,velicina,tip,in1,in2;

	event(){}

	event(llint x,llint y, llint z,llint i1,llint i2) {
		a = x;
		b = y;
		velicina = b - a + 1;
		tip = z;
		in1 = i1;
		in2 = i2;
	}

	friend bool operator < (event a,event b) {
		if (a.a != b.a) return a.a < b.a;
		if (a.velicina != b.velicina) return a.velicina < b.velicina;
		return a.in1 < b.in1;
	}
};

set <pair <llint,llint> > s;
set <pair <llint,llint> >::iterator it;

vector <event> v;

llint n,m;
llint a,b;

int main()  {
	scanf("%I64d %I64d",&n,&m);

	llint preva, prevb;

	if (n - 1 > m) {
		printf("No\n");
		return 0;
	}

	for (llint i = 0; i < n; i++) {
		scanf("%I64d %I64d",&a,&b);
		if (i == 0) {
			preva = a;
			prevb = b;
			continue;
		}

		v.push_back(event(a - prevb, b - preva, -1, i - 1, i));
		preva = a;
		prevb = b;
	}

	sort(v.begin(),v.end());

	for (llint i = 0; i <m; i++) {
    	scanf("%I64d",&a);
    	s.insert(make_pair(a,i));
    }

    llint sol[MAXN];

    for (llint i = 0; i < (llint)v.size(); i++) {
    	event x = v[i];

    	if ((int)s.size() == 0) {
    		printf("No\n");
    		return 0;
    	}
    	it = s.lower_bound(make_pair(x.velicina,0));
    	if (it == s.end() || it -> first > x.b) {
    		printf("No\n");
    		return 0;
    	}

    	sol[x.in1] = it -> second + 1;
    	s.erase(it);
    }

	printf("Yes\n");

	for (llint i = 0; i < n - 1; i++)
		printf("%I64d ",sol[i]);
	printf("\n");
	return 0;
}


#include <cstdio>
#include <set>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long llint;

const int MAXN = 200100;

struct event {
	llint a,b,velicina,tip,in1,in2;

	event(){}

	event(llint x,llint y, llint z,llint i1,llint i2) {
		a = x;
		b = y;
		velicina = b - a + 1;
		tip = z;
		in1 = i1;
		in2 = i2;
	}

	friend bool operator < (event a,event b) {
		if (a.a != b.a) return a.a < b.a;
		if (a.tip != b.tip) return a.tip < b.tip;
		return a.in1 < b.in1;
	}
};

set <pair <llint,llint> > s;
set <pair <llint,llint> >::iterator it;

vector <event> v;

llint n,m;
llint a,b;

int main()  {
	scanf("%I64d %I64d",&n,&m);

	llint preva, prevb;

	for (llint i = 0; i < n; i++) {
		scanf("%I64d %I64d",&a,&b);
		if (i == 0) {
			preva = a;
			prevb = b;
			continue;
		}

		v.push_back(event(a - prevb, b - preva - 1, -1, i - 1, i));
		v.push_back(event(b - preva - 1, a - prevb, 4, i - 1, i));
		preva = a;
		prevb = b;
	}

	for (llint i = 0; i < m; i++) {
		scanf("%I64d",&a);
		v.push_back(event(a,a, 1, i + 1, -1));
	}

	sort(v.begin(),v.end());
	llint sol[MAXN];

	for (llint i = 0; i < (llint)v.size(); i++) {
		event x = v[i];

		if (x.tip == 1) {
			if ((int)s.size() == 0) continue;
			it = s.begin();

			sol[it -> second] = x.in1;
			s.erase(it);
		}
		else if (x.tip == -1) {
			s.insert(make_pair(x.velicina,x.in1));
		}
		else {
			if ((int)s.size() != 0 && s.find(make_pair(x.a - x.b + 1, x.in1)) != s.end()) {
				printf("No\n");
				return 0;
			}
		}
	}

	printf("Yes\n");

	for (llint i = 0; i < n - 1; i++)
		printf("%I64d ",sol[i]);
	printf("\n");
	return 0;
}


#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;

int N, M;
long long L[200011];
long long R[200011];
int Ans[200011];
pair <pair <long long, long long>, int> a[200011];
pair <long long, long long> b[200011];
priority_queue <pair <long long, int>, vector <pair <long long, int> >, greater <pair <long long, int> > > Hp;

inline int cmp (pair <long long, long long> A, pair <long long, long long> B)
{
    if (A.first == B.first) return A.second < B.second;
    return A.first < B.first;
}

inline int cmp2 (pair <pair <long long, long long>, int> A, pair <pair <long long, long long>, int> B)
{
    if (A.first.first == B.first.first) return A.first.second < B.first.second;
    return A.first.first < B.first.first;
}

int main ()
{
    cin >> N >> M;
    cin >> L[0] >> R[0];
    for (int i = 1; i < N; i++)
    {
        cin >> L[i] >> R[i];
        a[i].first.first = L[i] - R[i - 1];
        a[i].first.second = R[i] - L[i - 1];
        a[i].second = i;
    }
    for (int i = 0; i < M; i++)
        cin >> b[i].first, b[i].second = i + 1;
    sort (a + 1, a + N, cmp2);
    sort (b, b + M, cmp);
    int j = 1;
    for (int i = 0; i < M; i++)
    {
        for (; j < N; j++)
        {
            if (a[j].first.first > b[i].first) break;
            Hp.push (make_pair (a[j].first.second, a[j].second));
        }
        if (!Hp.empty ())
        {
            if (Hp.top ().first >= b[i].first)
            {
                Ans[Hp.top ().second] = b[i].second;
                Hp.pop ();
            }
        }
    }
    if (Hp.empty ())
    {
        cout << "Yes\n";
        for (int i = 1; i < N; i++)
            cout << Ans[i] << " ";
    }
    else cout << "No";
    return 0;
}


#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;

int N, M;
long long L[200011];
long long R[200011];
int Ans[200011];
pair <pair <long long, long long>, int> a[200011];
pair <long long, long long> b[200011];
priority_queue <pair <long long, int>, vector <pair <long long, int> >, greater <pair <long long, int> > > Hp;

inline int cmp (pair <long long, long long> A, pair <long long, long long> B)
{
    if (A.first == B.first) return A.second < B.second;
    return A.first < B.first;
}

inline int cmp2 (pair <pair <long long, long long>, int> A, pair <pair <long long, long long>, int> B)
{
    if (A.first.first == B.first.first) return A.first.second < B.first.second;
    return A.first.first < B.first.first;
}

int main ()
{
    cin >> N >> M;
    cin >> L[0] >> R[0];
    for (int i = 1; i < N; i++)
    {
        cin >> L[i] >> R[i];
        a[i].first.first = L[i] - R[i - 1];
        a[i].first.second = R[i] - L[i - 1];
        a[i].second = i;
    }
    for (int i = 0; i < M; i++)
        cin >> b[i].first, b[i].second = i + 1;
    sort (a, a + N, cmp2);
    sort (b, b + M, cmp);
    int j = 1;
    int good = 1;
    for (int i = 0; i < M; i++)
    {
        for (; j < N; j++)
        {
            if (a[j].first.first > b[i].first) break;
            Hp.push (make_pair (a[j].first.second, a[j].second));
        }
        if (!Hp.empty ())
        {
            if (Hp.top ().first >= b[i].first)
            {
                Ans[Hp.top ().second] = b[i].second;
                Hp.pop ();
            }
        }
    }
    if (Hp.empty ())
    {
        cout << "Yes\n";
        for (int i = 1; i < N; i++)
            cout << Ans[i] << " ";
    }
    else cout << "No";
    return 0;
}


#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;

int N, M;
long long L[200011];
long long R[200011];
int Ans[200011];
pair <pair <long long, long long>, int> a[200011];
pair <long long, long long> b[200011];
priority_queue <pair <long long, int>, vector <pair <long long, int> >, greater <pair <long long, int> > > Hp;

inline int cmp (pair <long long, long long> A, pair <long long, long long> B)
{
    if (A.first == B.first) return A.second < B.second;
    return A.first < B.first;
}

inline int cmp2 (pair <pair <long long, long long>, int> A, pair <pair <long long, long long>, int> B)
{
    if (A.first.first == B.first.first) return A.first.second < B.first.second;
    return A.first.first < B.first.first;
}

int main ()
{
    cin >> N >> M;
    cin >> L[0] >> R[0];
    for (int i = 1; i < N; i++)
    {
        cin >> L[i] >> R[i];
        a[i].first.first = L[i] - R[i - 1];
        a[i].first.second = R[i] - L[i - 1];
        a[i].second = i;
    }
    for (int i = 0; i < M; i++)
        cin >> b[i].first, b[i].second = i + 1;
    sort (a + 1, a + N, cmp2);
    sort (b, b + M, cmp);
    int j = 1;
    for (int i = 0; i < M; i++)
    {
        for (; j < N; j++)
        {
            if (a[j].first.first > b[i].first) break;
            Hp.push (make_pair (a[j].first.second, a[j].second));
        }
        if (!Hp.empty ())
        {
            if (Hp.top ().first >= b[i].first)
            {
                Ans[Hp.top ().second] = b[i].second;
                Hp.pop ();
            }
        }
    }
    if (Hp.empty () && j == N)
    {
        cout << "Yes\n";
        for (int i = 1; i < N; i++)
            cout << Ans[i] << " ";
    }
    else cout << "No";
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <utility>
#include <cstdlib>
#include <cctype>
#include <stack>
#include <iostream>
using namespace std;

struct data1
{
    long long coto, boro, index;
};

struct data2
{
    long long value, index;
};

data1 island[200010];
data2 bridge[200010];

long long ans[200010];

bool comp1(data1 p, data1 q)
{
    return p.coto < q.coto;
}

bool comp2(data2 p, data2 q)
{
    return p.value < q.value;
}

struct data
{
    long long boro, index;

    bool operator < (const data & p) const
    {
        return boro > p.boro;
    }
};

int main()
{
    long long n, m, prel, prer, postl, postr, i, j, k;

    scanf("%I64d %I64d", &n, &m);

    scanf("%I64d %I64d", &prel, &prer);

    for(i = 1; i < n; ++i)
    {
        scanf("%I64d %I64d", &postl, &postr);
        island[i].coto = postl - prer;
        island[i].boro = postr - prel;
        island[i].index = i;
        prer = postr;
        prel = postl;
    }

    sort(island + 1, island + n, comp1);

    for(i = 1; i <= m; ++i)
    {
        scanf("%I64d", &bridge[i].value);
        bridge[i].index = i;
    }

    sort(bridge + 1, bridge + m + 1, comp2);

    k = 1;
    i = 1;
    priority_queue <data> q;
    data info;

    for(j = 1; j <= m; ++j)
    {
        while(k < n && island[k].coto <= bridge[j].value)
        {
            info.boro = island[k].boro;
            info.index = island[k].index;
            q.push(info);
            ++k;
        }

        if(!q.empty())
        {
            info = q.top();
            if(info.boro >= bridge[j].value)
            {
                ans[i++] = info.index;
                q.pop();
                if(i == n)
                    break;
            }
        }
    }

    if(i == n)
    {
        printf("Yes\n");
        printf("%I64d", ans[1]);

        for(i = 2; i < n; ++i)
            printf(" %I64d", ans[i]);

        printf("\n");
    }
    else
        printf("No\n");

    return 0;
}
/*
6 9
1 4
10 18
23 29
33 43
46 57
59 77
11 32 32 19 20 17 32 24 32
*/


#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <utility>
#include <cstdlib>
#include <cctype>
#include <stack>
#include <iostream>
using namespace std;

struct data
{
    long long coto, boro, index;
};

data arr[200010];

struct data2
{
    long long value, index;
};

data2 bridge[200010];

long long ans[200010];

bool comp(data p, data q)
{
    if(p.boro != q.boro)
        return p.boro > q.boro;
    return p.coto > q.coto;
}

bool comp2(data2 p, data2 q)
{
    return p.value > q.value;
}

int main()
{
    long long n, m, prel, prer, postl, postr, i, j = 1;

    scanf("%I64d %I64d", &n, &m);

    scanf("%I64d %I64d", &prel, &prer);

    for(i = 1; i < n; ++i)
    {
        scanf("%I64d %I64d", &postl, &postr);
        arr[i].coto = postl - prer;
        arr[i].boro = postr - prel;
        arr[i].index = i;
        prer = postr;
        prel = postl;
    }

    sort(arr + 1, arr + n, comp);

    for(i = 1; i <= m; ++i)
    {
        scanf("%I64d", &bridge[i].value);
        bridge[i].index = i;
    }

    sort(bridge + 1, bridge + m + 1, comp2);

    //for(i = 1; i < n; ++i)
        //printf("%I64d %I64d________%I64d\n", arr[i].coto, arr[i].boro, arr[i].index);

    //for(i = 1; i <= m; ++i)
        //printf("%I64d %I64d********\n", bridge[i].value, bridge[i].index);

    for(i = 1; i < n; ++i)
    {
        while(j <= m && !(bridge[j].value >= arr[i].coto && bridge[j].value <= arr[i].boro))
            ++j;

        if(j > m)
            break;

        ans[arr[i].index] = bridge[j++].index;
    }

    if(i == n)
    {
        printf("Yes\n");
        printf("%I64d", ans[1]);

        for(i = 2; i < n; ++i)
            printf(" %I64d", ans[i]);

        printf("\n");
    }
    else
        printf("No\n");

    return 0;
}
/*
6 9
1 4
10 18
23 29
33 43
46 57
59 77
11 32 32 19 20 17 32 24 32
*/


#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <utility>
#include <cstdlib>
#include <cctype>
#include <stack>
#include <iostream>
using namespace std;

struct data1
{
    long long coto, boro, index;
};

struct data2
{
    long long value, index;
};

data1 island[200010];
data2 bridge[200010];

long long ans[200010];

bool comp1(data1 p, data1 q)
{
    return p.coto < q.coto;
}

bool comp2(data2 p, data2 q)
{
    return p.value < q.value;
}

struct data
{
    long long boro, index;

    bool operator < (const data & p) const
    {
        return boro > p.boro;
    }
};

int main()
{
    long long n, m, prel, prer, postl, postr, i, j, k;

    scanf("%I64d %I64d", &n, &m);

    scanf("%I64d %I64d", &prel, &prer);

    for(i = 1; i < n; ++i)
    {
        scanf("%I64d %I64d", &postl, &postr);
        island[i].coto = postl - prer;
        island[i].boro = postr - prel;
        island[i].index = i;
        prer = postr;
        prel = postl;
    }

    sort(island + 1, island + n, comp1);

    for(i = 1; i <= m; ++i)
    {
        scanf("%I64d", &bridge[i].value);
        bridge[i].index = i;
    }

    sort(bridge + 1, bridge + m + 1, comp2);

    k = 1;
    i = 1;
    priority_queue <data> q;
    data info;

    for(j = 1; j <= m; ++j)
    {
        while(k < n && island[k].coto <= bridge[j].value)
        {
            info.boro = island[k].boro;
            info.index = island[k].index;
            q.push(info);
            ++k;
        }

        if(!q.empty())
        {
            info = q.top();
            if(info.boro >= bridge[j].value)
            {
                ans[info.index] = bridge[j].index;
                q.pop();
                if(i++ == n)
                    break;
            }
            else
                break;
        }
    }

    if(i == n)
    {
        printf("Yes\n");
        printf("%I64d", ans[1]);

        for(i = 2; i < n; ++i)
            printf(" %I64d", ans[i]);

        printf("\n");
    }
    else
        printf("No\n");

    return 0;
}
/*
5 9
1 2
3 3
5 7
11 13
14 20
2 3 4 10 6 2 6 9 5

*/


#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <utility>
#include <cstdlib>
#include <cctype>
#include <stack>
#include <iostream>
using namespace std;

struct data1
{
    long long coto, boro, index;
};

struct data2
{
    long long value, index;
};

data1 island[200010];
data2 bridge[200010];

long long ans[200010];

bool comp1(data1 p, data1 q)
{
    return p.coto < q.coto;
}

bool comp2(data2 p, data2 q)
{
    return p.value < q.value;
}

struct data
{
    long long boro, index;

    bool operator < (const data & p) const
    {
        return boro > p.boro;
    }
};

int main()
{
    long long n, m, prel, prer, postl, postr, i, j, k;

    scanf("%I64d %I64d", &n, &m);

    scanf("%I64d %I64d", &prel, &prer);

    for(i = 1; i < n; ++i)
    {
        scanf("%I64d %I64d", &postl, &postr);
        island[i].coto = postl - prer;
        island[i].boro = postr - prel;
        island[i].index = i;
        prer = postr;
        prel = postl;
    }

    sort(island + 1, island + n, comp1);

    for(i = 1; i <= m; ++i)
    {
        scanf("%I64d", &bridge[i].value);
        bridge[i].index = i;
    }

    sort(bridge + 1, bridge + m + 1, comp2);

    k = 1;
    i = 1;
    priority_queue <data> q;
    data info;

    for(j = 1; j <= m; ++j)
    {
        while(k < n && island[k].coto <= bridge[j].value)
        {
            info.boro = island[k].boro;
            info.index = island[k].index;
            q.push(info);
            ++k;
        }

        if(!q.empty())
        {
            info = q.top();
            if(info.boro >= bridge[j].value)
            {
                ans[info.index] = bridge[j].index;
                q.pop();
                if(i++ == n)
                    break;
            }
        }
    }

    if(i == n)
    {
        printf("Yes\n");
        printf("%I64d", ans[1]);

        for(i = 2; i < n; ++i)
            printf(" %I64d", ans[i]);

        printf("\n");
    }
    else
        printf("No\n");

    return 0;
}
/*
5 9
1 2
3 3
5 7
11 13
14 20
2 3 4 10 6 2 6 9 5

*/


#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <utility>
#include <cstdlib>
#include <cctype>
#include <stack>
#include <iostream>
using namespace std;

struct data
{
    long long coto, boro, index;
};

data arr[200010];

struct data2
{
    long long value, index;
};

data2 bridge[200010];

long long ans[200010];

bool comp(data p, data q)
{
    if(p.coto != q.coto)
        return p.coto < q.coto;
    else
        return p.boro < q.boro;
}

bool comp2(data2 p, data2 q)
{
    return p.value < q.value;
}

int main()
{
    long long n, m, prel, prer, postl, postr, i, j = 1;

    scanf("%I64d %I64d", &n, &m);

    scanf("%I64d %I64d", &prel, &prer);

    for(i = 1; i < n; ++i)
    {
        scanf("%I64d %I64d", &postl, &postr);
        arr[i].coto = postl - prer;
        arr[i].boro = postr - prel;
        arr[i].index = i;
        prer = postr;
        prel = postl;
    }

    sort(arr + 1, arr + n, comp);

    for(i = 1; i <= m; ++i)
    {
        scanf("%I64d", &bridge[i].value);
        bridge[i].index = i;
    }

    sort(bridge + 1, bridge + m + 1, comp2);

    //for(i = 1; i < n; ++i)
      //  printf("%I64d %I64d________%I64d\n", arr[i].coto, arr[i].boro, arr[i].index);

    //for(i = 1; i <= m; ++i)
      //  printf("%I64d %I64d********\n", bridge[i].value, bridge[i].index);

    for(i = 1; i < n; ++i)
    {
        while(j <= m && !(bridge[j].value >= arr[i].coto && bridge[j].value <= arr[i].boro))
            ++j;

        if(j > m)
            break;

        ans[arr[i].index] = bridge[j++].index;
    }

    if(i == n)
    {
        printf("Yes\n");
        printf("%I64d", ans[1]);

        for(i = 2; i < n; ++i)
            printf(" %I64d", ans[i]);

        printf("\n");
    }
    else
        printf("No\n");

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <cmath>
#include <stack>
#include <cstdlib>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#define rep(i,a,b) for (int i=a;i<((b)+1);i++)
#define Rep(i,a,b) for (int i=a;i>=b;i--)
#define foreach(e,x) for (__typeof(x.begin()) e=x.begin();e!=x.end();e++)
#define mid ((l+r)>>1)  //segment tree
#define lson (k<<1)     //segment tree
#define rson (k<<1|1)   //segment tree
#define MEM(a,x) memset(a,x,sizeof a)
#define L ch[r][0]                  //splay tree
#define R ch[r][1]                  //splay tree
#define keyvalue ch[ch[root][1]][0] //splay tree
#define eps 1e-6
using namespace std;
const int N=200050;
const long long Mod=1e9+7;
const int inf=0x3f3f3f3f;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
int n,m;
ll l[N],r[N];
pair<pll,int> p[N];
set<pli> st;
set<pli>::iterator it;
int s[N];
int main() {
    scanf("%d%d",&n,&m);
    rep(i,1,n) {
        scanf("%lld%lld",&l[i],&r[i]);
        if (i>1) p[i-1]=make_pair(make_pair(l[i]-r[i-1],r[i]-l[i-1]),i-1);
    }
    rep(i,1,m) {
        ll x;
        scanf("%lld",&x);
        st.insert(pli(x,i));
    }
    sort(p+1,p+n);
    bool flag=true;
    rep(i,1,n-1) {
        ll l1=p[i].first.first,r1=p[i].first.second;
        it=st.lower_bound(pli(l1,0));
        if (it==st.end()) {
            flag=false;
            break;
        }
        if (it->first<l1) {
            flag=false;
            break;
        }
        s[p[i].second]=it->second;
        st.erase(it);
    }
    flag?puts("Yes"):puts("No");
    if (flag) {
        rep(i,1,n-1)    printf("%d ",s[i]);
        puts("");
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <cmath>
#include <stack>
#include <cstdlib>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#define rep(i,a,b) for (int i=a;i<((b)+1);i++)
#define Rep(i,a,b) for (int i=a;i>=b;i--)
#define foreach(e,x) for (__typeof(x.begin()) e=x.begin();e!=x.end();e++)
#define mid ((l+r)>>1)  //segment tree
#define lson (k<<1)     //segment tree
#define rson (k<<1|1)   //segment tree
#define MEM(a,x) memset(a,x,sizeof a)
#define L ch[r][0]                  //splay tree
#define R ch[r][1]                  //splay tree
#define keyvalue ch[ch[root][1]][0] //splay tree
#define eps 1e-6
using namespace std;
const int N=200050;
const long long Mod=1e9+7;
const int inf=0x3f3f3f3f;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
int n,m;
ll l[N],r[N];
pair<pll,int> p[N];
set<pli> st;
set<pli>::iterator it;
int s[N];
int main() {
    scanf("%d%d",&n,&m);
    rep(i,1,n) {
        scanf("%lld%lld",&l[i],&r[i]);
        if (i>1) p[i-1]=make_pair(make_pair(l[i]-r[i-1],r[i]-l[i-1]),i-1);
    }
    rep(i,1,m) {
        ll x;
        scanf("%lld",&x);
        st.insert(pli(x,i));
    }
    sort(p+1,p+n);
    //rep(i,1,n-1)    cout<<p[i].second<<" "<<p[i].first.first<<" "<<p[i].first.second<<endl;
    bool flag=true;
    rep(i,1,n-1) {
        ll l1=p[i].first.first,r1=p[i].first.second;
        it=st.lower_bound(pli(r1,1<<30));
        if (it==st.begin()) {
            flag=false;
            break;
        }
        it--;
        if (it->first<l1) {
            flag=false;
            break;
        }
        s[p[i].second]=it->second;
        st.erase(it);
    }
    flag?puts("Yes"):puts("No");
    if (flag) {
        rep(i,1,n-1)    printf("%d ",s[i]);
        puts("");
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <cmath>
#include <stack>
#include <cstdlib>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#define rep(i,a,b) for (int i=a;i<((b)+1);i++)
#define Rep(i,a,b) for (int i=a;i>=b;i--)
#define foreach(e,x) for (__typeof(x.begin()) e=x.begin();e!=x.end();e++)
#define mid ((l+r)>>1)  //segment tree
#define lson (k<<1)     //segment tree
#define rson (k<<1|1)   //segment tree
#define MEM(a,x) memset(a,x,sizeof a)
#define L ch[r][0]                  //splay tree
#define R ch[r][1]                  //splay tree
#define keyvalue ch[ch[root][1]][0] //splay tree
#define eps 1e-6
using namespace std;
const int N=200050;
const long long Mod=1e9+7;
const int inf=0x3f3f3f3f;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
int n,m;
ll l[N],r[N];
pair<pll,int> p[N];
set<pli> st;
set<pli>::iterator it;
int s[N];
int main() {
    scanf("%d%d",&n,&m);
    rep(i,1,n) {
        scanf("%lld%lld",&l[i],&r[i]);
        if (i>1) p[i-1]=make_pair(make_pair(l[i]-r[i-1],r[i]-l[i-1]),i-1);
    }
    rep(i,1,m) {
        ll x;
        scanf("%lld",&x);
        st.insert(pli(x,i));
    }
    sort(p+1,p+n);
    bool flag=true;
    rep(i,1,n-1) {
        ll l1=p[i].first.first,r1=p[i].first.second;
        it=st.lower_bound(pli(l1,0));
        if (it==st.end()) {
            flag=false;
            break;
        }
        if (it->first>r1) {
            flag=false;
            break;
        }
        s[p[i].second]=it->second;
        st.erase(it);
    }
    flag?puts("Yes"):puts("No");
    if (flag) {
        rep(i,1,n-1)    printf("%d ",s[i]);
        puts("");
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <cmath>
#include <stack>
#include <cstdlib>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#define rep(i,a,b) for (int i=a;i<((b)+1);i++)
#define Rep(i,a,b) for (int i=a;i>=b;i--)
#define foreach(e,x) for (__typeof(x.begin()) e=x.begin();e!=x.end();e++)
#define mid ((l+r)>>1)  //segment tree
#define lson (k<<1)     //segment tree
#define rson (k<<1|1)   //segment tree
#define MEM(a,x) memset(a,x,sizeof a)
#define L ch[r][0]                  //splay tree
#define R ch[r][1]                  //splay tree
#define keyvalue ch[ch[root][1]][0] //splay tree
#define eps 1e-6
using namespace std;
const int N=200050;
const long long Mod=1e9+7;
const int inf=0x3f3f3f3f;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
int n,m;
ll l[N],r[N];
pair<pll,int> p[N];
set<pli> st;
set<pli>::iterator it;
int s[N];
int main() {
    scanf("%d%d",&n,&m);
    rep(i,1,n) {
        scanf("%lld%lld",&l[i],&r[i]);
        if (i>1) p[i-1]=make_pair(make_pair(l[i]-r[i-1],r[i]-l[i-1]),i-1);
    }
    rep(i,1,m) {
        ll x;
        scanf("%lld",&x);
        st.insert(pli(x,i));
    }
    sort(p+1,p+n,greater<pair<pll,int> >());
    bool flag=true;
    rep(i,1,n-1) {
        ll l1=p[i].first.first,r1=p[i].first.second;
        it=st.lower_bound(pli(r1,1<<30));
        if (it==st.begin()) {
            flag=false;
            break;
        }
        it--;
        if (it->first<l1) {
            flag=false;
            break;
        }
        s[p[i].second]=it->second;
        st.erase(it);
    }
    flag?puts("Yes"):puts("No");
    if (flag) {
        rep(i,1,n-1)    printf("%d ",s[i]);
        puts("");
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;

struct Case
{
    LL Max, Min;
    int index;

    bool operator < (const Case &C) const
    {
        return Max < C.Max;
    }
};

struct Bridge
{
    LL len;
    int index;

    bool operator < (const Bridge &B) const
    {
        return len < B.len || (len == B.len && index < B.index);
    }
};

set<Bridge> S;
set<Bridge>::iterator it;
vector<Case> V;
int B[200001];

int main()
{
    int n, m;
    LL pl, pr;
    LL nl, nr;
    LL len;

    cin >> n >> m;

    cin >> pl >> pr;
    for(int i = 2; i <= n; i++)
    {
        cin >> nl >> nr;
        V.push_back((Case){nr-pl, nl-pr, i-1});
        pl = nl, pr = nr;
    }
    sort(V.begin(), V.end());
    for(int i = 1; i <= m; i++)
    {
        cin >> len;
        S.insert((Bridge){len, i});
    }

    bool ok = true;
    for(int i = 0; i < n-1; i++)
    {
        it = S.lower_bound((Bridge){V[i].Min, 0});
        if(it != S.end() && it->len <= V[i].Max)
        {
            B[V[i].index] = it->index;
            S.erase(it);
        }
        else
        {
            ok = false;
            break;
        }
    }
    if(ok)
    {
        cout << "Yes" << endl;
        for(int i = 1; i <= n-1; i++)
        {
            cout << B[i] << " ";
        }
        cout << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;

struct Case
{
    LL Max, Min;
    int index;

    bool operator < (const Case &C) const
    {
        return Max < C.Max;
    }
};

struct Bridge
{
    LL len;
    int index;

    bool operator < (const Bridge &B) const
    {
        return len < B.len || (len == B.len && index < B.index);
    }
};

set<Bridge> S;
set<Bridge>::iterator it;
vector<Case> V;
int B[200001];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n, m;
    LL pl, pr;
    LL nl, nr;
    LL len;

    cin >> n >> m;

    cin >> pl >> pr;
    for(int i = 2; i <= n; i++)
    {
        cin >> nl >> nr;
        V.push_back((Case){nr-pl, nl-pr, i-1});
        pl = nl, pr = nr;
    }
    sort(V.begin(), V.end());
    for(int i = 1; i <= m; i++)
    {
        cin >> len;
        S.insert((Bridge){len, i});
    }

    bool ok = true;
    for(int i = 0; i < n-1; i++)
    {
        it = S.lower_bound((Bridge){V[i].Min, 0});
        if(it != S.end() && it->len <= V[i].Max)
        {
            B[V[i].index] = it->index;
            S.erase(it);
        }
        else
        {
            ok = false;
            break;
        }
    }
    if(ok)
    {
        cout << "Yes" << endl;
        for(int i = 1; i <= n-1; i++)
        {
            cout << B[i] << " ";
        }
        cout << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;

typedef long long LL;

struct Case
{
    LL Max, Min;
    int index;

    bool operator < (const Case &C) const
    {
        return Max < C.Max;
    }
};

map< LL, vector<int> > M;
map< LL, vector<int> >::iterator it;
vector<Case> V;
int B[200001];

int main()
{
    int n, m;
    LL pl, pr;
    LL nl, nr;
    LL len;

    cin >> n >> m;

    cin >> pl >> pr;
    for(int i = 2; i <= n; i++)
    {
        cin >> nl >> nr;
        V.push_back((Case){nr-pl, nl-pr, i-1});
        pl = nl, pr = nr;
    }
    sort(V.begin(), V.end());
    for(int i = 1; i <= m; i++)
    {
        cin >> len;
        M[len].push_back(i);
    }

    bool ok = true;
    for(int i = 0; i < n-1; i++)
    {
        //cout << V[i].Max << " " << V[i].Min << endl;
        it = M.lower_bound(V[i].Min);
        //cout << it->first << endl;
        if(it != M.end() && it->first <= V[i].Max)
        {
            B[V[i].index] = it->second.back();
            it->second.pop_back();
            if(it->second.empty())
            {
                M.erase(it);
            }
        }
        else
        {
            ok = false;
            break;
        }
    }
    if(ok)
    {
        cout << "Yes" << endl;
        for(int i = 1; i <= n-1; i++)
        {
            cout << B[i] << " ";
        }
        cout << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;

typedef long long LL;

struct Case
{
    LL Max, Min;
    int index;

    bool operator < (const Case &C) const
    {
        return Max < C.Max;
    }
};

map< LL, vector<int> > M;
map< LL, vector<int> >::iterator it;
vector<Case> V;
int B[200001];

int main()
{
    int n, m;
    LL pl, pr;
    LL nl, nr;
    LL len;

    cin >> n >> m;

    cin >> pl >> pr;
    for(int i = 2; i <= n; i++)
    {
        cin >> nl >> nr;
        V.push_back((Case){nr-pl, nl-pr, i-1});
        pl = nl, pr = nr;
    }
    sort(V.begin(), V.end());
    for(int i = 1; i <= m; i++)
    {
        cin >> len;
        M[len].push_back(i);
    }

    bool ok = true;
    for(int i = 0; i < n-1; i++)
    {
        //cout << V[i].Max << " " << V[i].Min << endl;
        it = M.lower_bound(V[i].Min);
        //cout << it->first << endl;
        if(it->first <= V[i].Max)
        {
            B[V[i].index] = it->second.back();
            it->second.pop_back();
            if(it->second.empty())
            {
                M.erase(it);
            }
        }
        else
        {
            ok = false;
            break;
        }
    }
    if(ok)
    {
        cout << "Yes" << endl;
        for(int i = 1; i <= n-1; i++)
        {
            cout << B[i] << " ";
        }
        cout << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    int id;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];
struct bri{
    LL len;
    int id;
}b[maxn];
int vis[maxn];
LL l[maxn],r[maxn];
int cmpb(const void *a,const void *b){
    return ((bri *)a)->len-((bri *)b)->len>0?1:-1;
}
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA-((land *)b)->MA>0?1:-1;
        else return ((land *)a)->MI-((land *)b)->MI>0?1:-1;
}
int cmpaa(const void *a,const void *b){
    return ((land *)a)->loc-((land *)b)->loc>0?1:-1;
}
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++)
        a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
    for(int i=0;i<m;i++){
        scanf("%I64d",&b[i].len);
        b[i].id=i+1;
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    qsort(b,m,sizeof(b[0]),cmpb);
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        int j;
        for(j=0;j<m;j++)
            if(vis[j]) continue;
        else if(a[i].MI<=b[j].len&&b[j].len<=a[i].MA){
            a[i].id = b[j].id , vis[j]=1;
            break;
        }
        else if(b[j].len>a[i].MA){
            ok=0;
            break;
        }
        if(j==m) ok=0;
    }
    if(!ok) puts("No");
    else {
        puts("Yes");
        qsort(a,n-1,sizeof(a[0]),cmpaa);
        for(int i=0;i<n-1;i++)
            printf("%d\n",a[i].id);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<set>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    int id;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];
struct bri{
    LL len;
    int id;
    bool operator<(const bri &a)const{                //重载<,使优先队列队首始终是val最小的元素
        return len < a.len;
    }
    bri(){}
    bri(int lens,int iid){
        len=lens,id=iid;
    }
}bb;
int vis[maxn];
LL l[maxn],r[maxn];
int ans[maxn];
int cmpb(const void *a,const void *b){
    return ((bri *)a)->len-((bri *)b)->len>0?1:-1;
}
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA>((land *)b)->MA?1:-1;
    else return ((land *)a)->MI>((land *)b)->MI?1:-1;
}
int cmpaa(const void *a,const void *b){
    return ((land *)a)->loc>((land *)b)->loc?1:-1;
}
set<bri> b;
set<bri> ::iterator it;
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++)
        a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
    for(int i=0;i<m;i++){
        LL len;
        scanf("%I64d",&len);
        b.insert(bri(len,i+1));
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        it = b.lower_bound(bri(a[i].MI,0));
        if(it==b.end()||it->len>a[i].MA ) ok=0;
        else {
            ans[a[i].loc] = it->id;
            b.erase(it);
        }
    }
    if(!ok) puts("No");
    else {
        puts("Yes");

        for(int i=1;i<=n-1;i++)
            printf("%d\n",ans[i]);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    int id;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];
struct bri{
    LL len;
    int id;
    bool operator<(const bri &a)const{                //重载<,使优先队列队首始终是val最小的元素
        return len < a.len;
    }
    bri(){}
    bri(int lens,int iid){
        len=lens,id=iid;
    }
}bb;
vector<bri> b;
vector<bri> ::iterator it;
int vis[maxn];
LL l[maxn],r[maxn];
int ans[maxn];
int cmpb(const void *a,const void *b){
    return ((bri *)a)->len-((bri *)b)->len>0?1:-1;
}
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA-((land *)b)->MA>0?1:-1;
        else return ((land *)a)->MI-((land *)b)->MI>0?1:-1;
}
int cmpaa(const void *a,const void *b){
    return ((land *)a)->loc-((land *)b)->loc>0?1:-1;
}
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++)
        a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
    for(int i=0;i<m;i++){
        LL len;
        scanf("%I64d",&len);
        b.push_back(bri(len,i+1));
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    sort(b.begin(),b.end());
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        it = lower_bound(b.begin(),b.end(),bri(a[i].MI,0));
        if(it==b.end()||it->len>a[i].MA ) ok=0;
        else {

            ans[a[i].loc] = it->id;
            b.erase(it);
        }
    }
    if(!ok) puts("No");
    else {
        puts("Yes");

        for(int i=1;i<=n-1;i++)
            printf("%d\n",ans[i]);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<set>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    int id;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];
struct bri{
    LL len;
    int id;
    bool operator<(const bri &a)const{                //重载<,使优先队列队首始终是val最小的元素
        return len < a.len;
    }
    bri(){}
    bri(int lens,int iid){
        len=lens,id=iid;
    }
}bb;
int vis[maxn];
LL l[maxn],r[maxn];
int ans[maxn];
int cmpb(const void *a,const void *b){
    return ((bri *)a)->len-((bri *)b)->len>0?1:-1;
}
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA>((land *)b)->MA?1:-1;
    else return ((land *)a)->MI>((land *)b)->MI?1:-1;
}
int cmpaa(const void *a,const void *b){
    return ((land *)a)->loc>((land *)b)->loc?1:-1;
}
set<bri> b;
set<bri> ::iterator it;
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++)
        a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
    for(int i=0;i<m;i++){
        LL len;
        scanf("%I64d",&len);
        b.insert(bri(len,i+1));
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        it = lower_bound(b.begin(),b.end(),bri(a[i].MI,0));
        if(it==b.end()||it->len>a[i].MA ) ok=0;
        else {

            ans[a[i].loc] = it->id;
            b.erase(it);
        }
    }
    if(!ok) puts("No");
    else {
        puts("Yes");

        for(int i=1;i<=n-1;i++)
            printf("%d\n",ans[i]);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    int id;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];
struct bri{
    LL len;
    int id;
    bool operator<(const bri &a)const{                //重载<,使优先队列队首始终是val最小的元素
        return len < a.len;
    }
    bri(){}
    bri(int lens,int iid){
        len=lens,id=iid;
    }
}bb;
vector<bri> b;
vector<bri> ::iterator it;
int vis[maxn];
LL l[maxn],r[maxn];
int cmpb(const void *a,const void *b){
    return ((bri *)a)->len-((bri *)b)->len>0?1:-1;
}
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA-((land *)b)->MA>0?1:-1;
        else return ((land *)a)->MI-((land *)b)->MI>0?1:-1;
}
int cmpaa(const void *a,const void *b){
    return ((land *)a)->loc-((land *)b)->loc>0?1:-1;
}
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++)
        a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
    for(int i=0;i<m;i++){
        LL len;
        scanf("%I64d",&len);
        b.push_back(bri(len,i+1));
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    sort(b.begin(),b.end());
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        it = lower_bound(b.begin(),b.end(),bri(a[i].MI,0));
        if(it==b.end()||it->len>a[i].MA ) ok=0;
        else {
            a[i].id = it->id;
            b.erase(it);
        }
    }
    if(!ok) puts("No");
    else {
        puts("Yes");
        qsort(a,n-1,sizeof(a[0]),cmpaa);
        for(int i=0;i<n-1;i++)
            printf("%d\n",a[i].id);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<set>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    int id;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];
struct bri{
    LL len;
    int id;
    bool operator<(const bri &a)const{                //重载<,使优先队列队首始终是val最小的元素
        return len < a.len;
    }
    bri(){}
    bri(int lens,int iid){
        len=lens,id=iid;
    }
}bb;
int vis[maxn];
LL l[maxn],r[maxn];
int ans[maxn];
int cmpb(const void *a,const void *b){
    return ((bri *)a)->len-((bri *)b)->len>0?1:-1;
}
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA>((land *)b)->MA?1:-1;
    else return ((land *)a)->MI>((land *)b)->MI?1:-1;
}
int cmpaa(const void *a,const void *b){
    return ((land *)a)->loc>((land *)b)->loc?1:-1;
}
set<bri> b;
set<bri> ::iterator it;
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++)
        a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
    for(int i=0;i<m;i++){
        LL len;
        scanf("%I64d",&len);
        b.insert(bri(len,i+1));
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        it = b.lower_bound(bri(a[i].MI,0));
        if(it==b.end()||(it->len)>a[i].MA ) ok=0;
        else {
            ans[a[i].loc] = it->id;
            b.erase(it);
        }
    }
    if(!ok) puts("No");
    else {
        puts("Yes");

        for(int i=1;i<=n-1;i++)
            printf("%d\n",ans[i]);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<set>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
int vis[maxn];
LL l[maxn],r[maxn];
int ans[maxn];

pair< pair<LL,LL> , int>  a[maxn];
set<pair<LL,int> > b;
set<pair<LL,int> > ::iterator it;
int main(void){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
		scanf("%I64d%I64d",&l[i],&r[i]);
	for(int i=1;i<n;i++){
		a[i-1].first.second = l[i]-r[i-1];
		a[i-1].first.first = r[i]-l[i-1];
		a[i-1].second = i;
	}

	for(int i=0;i<m;i++){
		LL len;
		scanf("%I64d",&len);
		b.insert(make_pair(len,i+1));
	}
	sort(a,a+n-1);
	int ok=1;
	for(int i=0;i<n-1&&ok;i++){
		it = b.lower_bound(make_pair(a[i].first.second,0));
		if(it==b.end()||(it->first)>a[i].first.first ) ok=0;
		else {
			ans[a[i].second] = it->second;
			b.erase(it);
		}
	}
	if(!ok) puts("No");
	else {
		puts("Yes");
		for(int i=1;i<=n-1;i++)
			printf("%d\n",ans[i]);
	}
	return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
	LL MI,MA;
	int loc;
	int id;
	land(){}
	land(LL mi,LL ma,int locc){
		MI=mi,MA=ma,loc=locc;
	}
}a[maxn];
struct bri{
	LL len;
	int id;
}b[maxn];
int vis[maxn];
LL l[maxn],r[maxn];
int cmpb(const void *a,const void *b){
	return ((bri *)a)->len-((bri *)b)->len>0?1:-1;
}
int cmpa(const void *a,const void *b){
	if(((land *)a)->MA!=((land *)b)->MA)
			return ((land *)a)->MA-((land *)b)->MA>0?1:-1;
		else return ((land *)a)->MI-((land *)b)->MI>0?1:-1;
}
int cmpaa(const void *a,const void *b){
	return ((land *)a)->loc-((land *)b)->loc>0?1:-1;
}
int main(void){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
		scanf("%I64d%I64d",&l[i],&r[i]);
	for(int i=1;i<n;i++)
		a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
	for(int i=0;i<m;i++){
		scanf("%I64d",&b[i].len);
		b[i].id=i+1;
	}
	qsort(a,n-1,sizeof(a[0]),cmpa);
	qsort(b,m,sizeof(b[0]),cmpb);
	int ok=1;
	for(int i=0;i<n-1&&ok;i++){
		for(int j=0;j<m;j++)
			if(vis[j]) continue;
		else if(a[i].MI<=b[j].len&&b[j].len<=a[i].MA){
			a[i].id = b[j].id , vis[j]=1;
			break;
		}
		else if(b[j].len>a[i].MA){
			ok=0;
			break;
		}
	}
	if(!ok) puts("No");
	else {
		puts("Yes");
		qsort(a,n-1,sizeof(a[0]),cmpaa);
		for(int i=0;i<n-1;i++)
			printf("%d\n",a[i].id);
	}
	return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<set>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];
struct bri{
    LL len;
    int id;
    bool operator<(const bri &a)const{                //重载<,使优先队列队首始终是val最小的元素
        if(len!=a.len)
            return len < a.len;
        else return id < a.id;
    }
    bri(){}
    bri(int lens,int iid){
        len=lens,id=iid;
    }
}bb;
int vis[maxn];
LL l[maxn],r[maxn];
int ans[maxn];
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA>((land *)b)->MA?1:-1;
    else return ((land *)a)->MI>((land *)b)->MI?1:-1;
}
set<bri> b;
set<bri> ::iterator it;
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++)
        a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
    for(int i=0;i<m;i++){
        LL len;
        scanf("%I64d",&len);
        b.insert(bri(len,i+1));
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        it = b.lower_bound(bri(a[i].MI,0));
        if(it==b.end()||(it->len)>a[i].MA ) ok=0;
        else {
            ans[a[i].loc] = it->id;
            b.erase(it);
        }
    }
    if(!ok) puts("No");
    else {
        puts("Yes");

        for(int i=1;i<=n-1;i++)
            printf("%d\n",ans[i]);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<set>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];
struct bri{
    LL len;
    int id;
    bool operator<(const bri &a)const{                //重载<,使优先队列队首始终是val最小的元素
        if(len!=a.len)
            return len < a.len;
        else return id < a.id;
    }
    bri(){}
    bri(int lens,int iid){
        len=lens,id=iid;
    }
}bb;
int vis[maxn];
LL l[maxn],r[maxn];
int ans[maxn];
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA>((land *)b)->MA?1:-1;
    else return ((land *)a)->MI>((land *)b)->MI?1:-1;
}
set<bri> b;
set<bri> ::iterator it;
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++){
        a[i-1].MI = l[i]-r[i-1];
        a[i-1].MA = r[i]-l[i-1];
        a[i-1].loc = i;
    }

    for(int i=0;i<m;i++){
        scanf("%I64d",&bb.len);
        bb.id = i+1;
        b.insert(bb);
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        it = b.lower_bound(bri(a[i].MI,0));
        if(it==b.end()||(it->len)>a[i].MA ) ok=0;
        else {
            ans[a[i].loc] = it->id;
            b.erase(it);
        }
    }
    if(!ok) puts("No");
    else {
        puts("Yes");
        for(int i=1;i<=n-1;i++)
            printf("%d\n",ans[i]);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<set>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];

int vis[maxn];
LL l[maxn],r[maxn];
int ans[maxn];
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA>((land *)b)->MA?1:-1;
    else return ((land *)a)->MI>((land *)b)->MI?1:-1;
}
set<pair<LL,int> > b;
set<pair<LL,int> > ::iterator it;
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++){
        a[i-1].MI = l[i]-r[i-1];
        a[i-1].MA = r[i]-l[i-1];
        a[i-1].loc = i;
    }

    for(int i=0;i<m;i++){
        LL len;
        scanf("%I64d",&len);
        b.insert(make_pair(len,i+1));
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        it = b.lower_bound(make_pair(a[i].MI,0));
        if(it==b.end()||(it->first)>a[i].MA ) ok=0;
        else {
            ans[a[i].loc] = it->second;
            b.erase(it);
        }
    }
    if(!ok) puts("No");
    else {
        puts("Yes");
        for(int i=1;i<=n-1;i++)
            printf("%d\n",ans[i]);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    int id;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];
struct bri{
    LL len;
    int id;
    bool operator<(const bri &a)const{                //重载<,使优先队列队首始终是val最小的元素
        return len < a.len;
    }
    bri(){}
    bri(int lens){
        len=lens;
    }
}b[maxn];
int vis[maxn];
LL l[maxn],r[maxn];
int cmpb(const void *a,const void *b){
    return ((bri *)a)->len-((bri *)b)->len>0?1:-1;
}
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA-((land *)b)->MA>0?1:-1;
        else return ((land *)a)->MI-((land *)b)->MI>0?1:-1;
}
int cmpaa(const void *a,const void *b){
    return ((land *)a)->loc-((land *)b)->loc>0?1:-1;
}
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++)
        a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
    for(int i=0;i<m;i++){
        scanf("%I64d",&b[i].len);
        b[i].id=i+1;
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    qsort(b,m,sizeof(b[0]),cmpb);
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        int j=lower_bound(b,b+m,bri(a[i].MI))-b;
        for(;j<m;j++)
            if(b[j].len>a[i].MA){
                ok=0;
                break;
            }
            else if(vis[j]) continue;
            else if(a[i].MI<=b[j].len&&b[j].len<=a[i].MA){
                a[i].id = b[j].id , vis[j]=1;
                break;
            }
        if(j==m) ok=0;
    }
    if(!ok) puts("No");
    else {
        puts("Yes");
        qsort(a,n-1,sizeof(a[0]),cmpaa);
        for(int i=0;i<n-1;i++)
            printf("%d\n",a[i].id);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
    LL MI,MA;
    int loc;
    int id;
    land(){}
    land(LL mi,LL ma,int locc){
        MI=mi,MA=ma,loc=locc;
    }
}a[maxn];
struct bri{
    LL len;
    int id;
}b[maxn];
int vis[maxn];
LL l[maxn],r[maxn];
int cmpb(const void *a,const void *b){
    return ((bri *)a)->len-((bri *)b)->len>0?1:-1;
}
int cmpa(const void *a,const void *b){
    if(((land *)a)->MA!=((land *)b)->MA)
            return ((land *)a)->MA-((land *)b)->MA>0?1:-1;
        else return ((land *)a)->MI-((land *)b)->MI>0?1:-1;
}
int cmpaa(const void *a,const void *b){
    return ((land *)a)->loc-((land *)b)->loc>0?1:-1;
}
int main(void){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++)
        scanf("%I64d%I64d",&l[i],&r[i]);
    for(int i=1;i<n;i++)
        a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
    for(int i=0;i<m;i++){
        scanf("%I64d",&b[i].len);
        b[i].id=i+1;
    }
    qsort(a,n-1,sizeof(a[0]),cmpa);
    qsort(b,m,sizeof(b[0]),cmpb);
    int ok=1;
    for(int i=0;i<n-1&&ok;i++){
        int j=lower_bound(b,b+m,a[i].MI)-b;
        for(;j<m;j++)
            if(b[j].len>a[i].MA){
                ok=0;
                break;
            }
            else if(vis[j]) continue;
            else if(a[i].MI<=b[j].len&&b[j].len<=a[i].MA){
                a[i].id = b[j].id , vis[j]=1;
                break;
            }
        if(j==m) ok=0;
    }
    if(!ok) puts("No");
    else {
        puts("Yes");
        qsort(a,n-1,sizeof(a[0]),cmpaa);
        for(int i=0;i<n-1;i++)
            printf("%d\n",a[i].id);
    }
    return 0;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>

#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<iostream>
using namespace std;

#define LL long long
#define ULL unsigned long long
const int maxn = 200005;
struct land{
	LL MI,MA;
	int loc;
	int id;
	land(){}
	land(LL mi,LL ma,int locc){
		MI=mi,MA=ma,loc=locc;
	}
}a[maxn];
struct bri{
	LL len;
	int id;
	bool operator<(const bri &a)const{                //重载<,使优先队列队首始终是val最小的元素
		return len < a.len;
	}
	bri(){}
	bri(int lens,int iid){
		len=lens,id=iid;
	}
}bb;
vector<bri> b;
vector<bri> ::iterator it;
int vis[maxn];
LL l[maxn],r[maxn];
int ans[maxn];
int cmpb(const void *a,const void *b){
	return ((bri *)a)->len-((bri *)b)->len>0?1:-1;
}
int cmpa(const void *a,const void *b){
	if(((land *)a)->MA!=((land *)b)->MA)
			return ((land *)a)->MA-((land *)b)->MA>0?1:-1;
		else return ((land *)a)->MI-((land *)b)->MI>0?1:-1;
}
int cmpaa(const void *a,const void *b){
	return ((land *)a)->loc-((land *)b)->loc>0?1:-1;
}
int main(void){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
		scanf("%I64d%I64d",&l[i],&r[i]);
	for(int i=1;i<n;i++)
		a[i-1]=land(l[i]-r[i-1],r[i]-l[i-1],i);
	for(int i=0;i<m;i++){
		LL len;
		scanf("%I64d",&len);
		b.push_back(bri(len,i+1));
	}
	qsort(a,n-1,sizeof(a[0]),cmpa);
	sort(b.begin(),b.end());
	int ok=1;
	for(int i=0;i<n-1&&ok;i++){
		it = lower_bound(b.begin(),b.end(),bri(a[i].MI,0));
		if(it==b.end()||it->len>a[i].MA ) ok=0;
		else {

			ans[a[i].loc] = it->id;
			b.erase(it);
		}
	}
	if(!ok) puts("No");
	else {
		puts("Yes");
		qsort(a,n-1,sizeof(a[0]),cmpaa);
		for(int i=1;i<=n-1;i++)
			printf("%d\n",ans[i]);
	}
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <functional>
using namespace std;

#define ll long long
#define pi pair<int,int>
#define pll pair<ll,ll>
#define pii pair<pi,int>
#define X first
#define Y second
#define pb push_back
#define ab(x) ((x)<0?(-(x)):(x))
#define xx(x) ((x)*(x))
#define mp make_pair
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
#define vpi vector<pi>
#define vpll vector<pll>
#define ALL(x) (x).begin(),(x).end()
#define Max (1<<30)
#define LLMax (1ll<<60)
template<class T>string ToString(T t) { stringstream s; s << t; return s.str(); }
template<class T>void ToOther(T&t, string a) { stringstream s(a); s >> t; }

int n, m;
vpi temp;
vpi a;
int r[200005];

vector<pii> v;
pii make(int a, int b, int c) { return mp(mp(a, b), c); }

void End() {
	cout << "No" << endl;
	exit(0);
}

int main() {
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		int s, e; scanf("%d%d", &s, &e);
		temp.pb(pi(s, e));
	}
	a.resize(m);
	for (int i = 0; i < m; i++)scanf("%d", &a[i].first),a[i].second = i;

	sort(ALL(a));
	for (int i = 1; i < n; i++)
		v.pb(
			make(
				temp[i].first - temp[i - 1].second,
				temp[i].second - temp[i - 1].first,
				i
			)
		);

	sort(ALL(v));

	int pos = 0;

	priority_queue<pi, vpi, greater<pi> >q;
	for (int i = 0; i < a.size(); i++) {
		while (pos < v.size() && v[pos].first.first <= a[i].first) {
			q.push(pi(v[pos].first.second, v[pos].second));
			pos++;
		}

		if (q.size() && q.top().first >= a[i].first) {
			r[q.top().second] = a[i].second + 1;
			q.pop();
		}
	}
	if (pos != v.size() || q.size())End();

	cout << "Yes" << endl;
	for (int i = 1; i < n; i++)printf("%d ", r[i] );
	puts("");
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <functional>
using namespace std;

#define ll long long
#define pi pair<ll,ll>
#define pll pair<ll,ll>
#define pii pair<pi,ll>
#define X first
#define Y second
#define pb push_back
#define ab(x) ((x)<0?(-(x)):(x))
#define xx(x) ((x)*(x))
#define mp make_pair
#define vi vector<ll>
#define vll vector<ll>
#define vs vector<string>
#define vpi vector<pi>
#define vpll vector<pll>
#define ALL(x) (x).begin(),(x).end()
#define Max (1<<30)
#define LLMax (1ll<<60)
template<class T>string ToString(T t) { stringstream s; s << t; return s.str(); }
template<class T>void ToOther(T&t, string a) { stringstream s(a); s >> t; }

int n, m;
vpi temp;
vpi a;
ll r[200005];

vector<pii> v;
pii make(ll a, ll b, ll c) { return mp(mp(a, b), c); }

void End() {
	cout << "No" << endl;
	exit(0);
}

int main() {
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		int s, e; scanf("%lld%lld", &s, &e);
		temp.pb(pi(s, e));
	}
	a.resize(m);
	for (int i = 0; i < m; i++)scanf("%lld", &a[i].first),a[i].second = i;

	sort(ALL(a));
	for (int i = 1; i < n; i++)
		v.pb(
			make(
				temp[i].first - temp[i - 1].second,
				temp[i].second - temp[i - 1].first,
				i
			)
		);

	sort(ALL(v));

	int pos = 0;

	priority_queue<pi, vpi, greater<pi> >q;
	for (int i = 0; i < a.size(); i++) {
		while (pos < v.size() && v[pos].first.first <= a[i].first) {
			q.push(pi(v[pos].first.second, v[pos].second));
			pos++;
		}

		if (q.size() && q.top().first >= a[i].first) {
			r[q.top().second] = a[i].second + 1;
			q.pop();
		}
	}
	if (pos != v.size() || q.size())End();

	cout << "Yes" << endl;
	for (int i = 1; i < n; i++)printf("%lld ", r[i] );
	puts("");
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <functional>
using namespace std;

#define ll long long
#define pi pair<ll,ll>
#define pll pair<ll,ll>
#define pii pair<pi,ll>
#define X first
#define Y second
#define pb push_back
#define ab(x) ((x)<0?(-(x)):(x))
#define xx(x) ((x)*(x))
#define mp make_pair
#define vi vector<ll>
#define vll vector<ll>
#define vs vector<string>
#define vpi vector<pi>
#define vpll vector<pll>
#define ALL(x) (x).begin(),(x).end()
#define Max (1<<30)
#define LLMax (1ll<<60)
template<class T>string ToString(T t) { stringstream s; s << t; return s.str(); }
template<class T>void ToOther(T&t, string a) { stringstream s(a); s >> t; }

int n, m;
vpi temp;
vpi a;
ll r[200005];

vector<pii> v;
pii make(ll a, ll b, ll c) { return mp(mp(a, b), c); }

void End() {
	cout << "No" << endl;
	exit(0);
}

int main() {
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		ll s, e; scanf("%lld%lld", &s, &e);
		temp.pb(pi(s, e));
	}
	a.resize(m);
	for (int i = 0; i < m; i++)scanf("%lld", &a[i].first), a[i].second = i;

	sort(ALL(a));
	for (int i = 1; i < n; i++)
		v.pb(
			make(
				temp[i].first - temp[i - 1].second,
				temp[i].second - temp[i - 1].first,
				i
				)
			);

	sort(ALL(v));

	int pos = 0;

	priority_queue<pi, vpi, greater<pi> >q;
	for (int i = 0; i < a.size(); i++) {
		while (pos < v.size() && v[pos].first.first <= a[i].first) {
			q.push(pi(v[pos].first.second, v[pos].second));
			pos++;
		}

		if (q.size() && q.top().first >= a[i].first) {
			r[q.top().second] = a[i].second + 1;
			q.pop();
		}
	}
	if (pos != v.size() || q.size())End();

	cout << "Yes" << endl;
	for (int i = 1; i < n; i++)printf("%lld ", r[i]);
	puts("");
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back

using namespace std;

struct bridge {
    int gt, cs;
};

struct island {
    int u, v;
};

struct bg {
    int u, v, cs;
};

const int nm = 200002;

int n, m;
island a[nm];
bridge b[nm];
bg c[nm];
int kq[nm];

bool cmp(bridge a, bridge b) {
    return a.gt < b.gt;
}

bool cmp2(bg a, bg b) {
    if (a.u != b.u)
        return a.u < b.u;
    return a.v < b.v;
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i)
        scanf("%d%d", &a[i].u, &a[i].v);
    for (int i = 1; i <= m; ++i) {
        scanf("%d", &b[i].gt);
        b[i].cs = i;
    }
    sort(b + 1, b + m + 1, cmp);
    for (int i = 1; i < n; ++i) {
        c[i].u = a[i + 1].u - a[i].v;
        c[i].v = a[i + 1].v - a[i].u;
        c[i].cs = i;
    }
    sort(c + 1, c + n, cmp2);
    int j = 1;
    for (int i = 1; i < n; ++i) {
        while (j <= m && b[j].gt < c[i].u)
            j++;
        if (j > m || b[j].gt > c[i].v) {
            printf("No\n");
            return 0;
        }
        kq[c[i].cs] = b[j].cs;
        j++;
    }
    printf("Yes\n");
    for (int i = 1; i < n; ++i)
        printf("%d ", kq[i]);
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back

using namespace std;

struct bridge {
    ll gt;
    int cs;
};

struct island {
    ll u, v;
};

struct bg {
    ll u, v;
    int cs;
};

const int nm = 200002;

int n, m;
island a[nm];
bridge b[nm];
bg c[nm];
int kq[nm];

bool cmp(bridge a, bridge b) {
    return a.gt < b.gt;
}

bool cmp2(bg a, bg b) {
    if (a.u != b.u)
        return a.u < b.u;
    return a.v < b.v;
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i)
        scanf("%I64d%I64d", &a[i].u, &a[i].v);
    for (int i = 1; i <= m; ++i) {
        scanf("%I64d", &b[i].gt);
        b[i].cs = i;
    }
    sort(b + 1, b + m + 1, cmp);
    for (int i = 1; i < n; ++i) {
        c[i].u = a[i + 1].u - a[i].v;
        c[i].v = a[i + 1].v - a[i].u;
        c[i].cs = i;
    }
    sort(c + 1, c + n, cmp2);
    int j = 1;
    for (int i = 1; i < n; ++i) {
        while (j <= m && b[j].gt < c[i].u)
            j++;
        if (j > m || b[j].gt > c[i].v) {
            printf("No\n");
            return 0;
        }
        kq[c[i].cs] = b[j].cs;
        j++;
    }
    printf("Yes\n");
    for (int i = 1; i < n; ++i)
        printf("%d ", kq[i]);
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back

using namespace std;

struct bridge {
    ll gt;
    int cs;
};

struct island {
    ll u, v;
};

struct bg {
    int u, v;
    int cs;
};

const int nm = 200002;

int n, m;
island a[nm];
bridge b[nm];
bg c[nm];
int kq[nm];

bool cmp(bridge a, bridge b) {
    return a.gt < b.gt;
}

bool cmp2(bg a, bg b) {
    if (a.u != b.u)
        return a.u < b.u;
    return a.v < b.v;
}

int find(ll x) {
    int l = 1, r = m, kq = m + 1;
    while (l <= r) {
        int mid = (l + r) >> 1;
        if (b[mid].gt >= x) {
            kq = mid;
            r = mid - 1;
        } else
            l = mid + 1;
    }
    return kq;
}

int find2(ll x) {
    int l = 1, r = m, kq = 0;
    while (l <= r) {
        int mid = (l + r) >> 1;
        if (b[mid].gt <= x) {
            kq = mid;
            l = mid + 1;
        } else
            r = mid - 1;
    }
    return kq;
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i)
        scanf("%I64d%I64d", &a[i].u, &a[i].v);
    for (int i = 1; i <= m; ++i) {
        scanf("%I64d", &b[i].gt);
        b[i].cs = i;
    }
    sort(b + 1, b + m + 1, cmp);
    for (int i = 1; i < n; ++i) {
        c[i].u = find(a[i + 1].u - a[i].v);
        c[i].v = find2(a[i + 1].v - a[i].u);
        c[i].cs = i;
    }
    sort(c + 1, c + n, cmp2);
    int j = 1;
    for (int i = 1; i < n; ++i) {
        j = max(j, c[i].u);
        if (j > c[i].v) {
            printf("No\n");
            return 0;
        }
        kq[c[i].cs] = b[j].cs;
        j++;
    }
    printf("Yes\n");
    for (int i = 1; i < n; ++i)
        printf("%d ", kq[i]);
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define mp make_pair

using namespace std;

struct island {
    ll u, v;
};

struct bg {
    ll u, v;
    int cs;
};

const int nm = 200002;

int n, m;
island a[nm];
bg c[nm];
int kq[nm];
set<pair<ll, int> > b;

bool cmp2(bg a, bg b) {
    if (a.v != b.v)
        return a.v < b.v;
    return a.u < b.u;
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= n; ++i)
        scanf("%I64d%I64d", &a[i].u, &a[i].v);
    for (int i = 1; i <= m; ++i) {
        ll x;
        scanf("%I64d", &x);
        b.insert(mp(x, i));
    }
    for (int i = 1; i < n; ++i) {
        c[i].u = a[i + 1].u - a[i].v;
        c[i].v = a[i + 1].v - a[i].u;
        c[i].cs = i;
    }
    sort(c + 1, c + n, cmp2);
    for (int i = 1; i < n; ++i) {
        set<pair<ll, int> >::iterator it = b.lower_bound(mp(c[i].u, -1));
        if (it == b.end() || it->first > c[i].v) {
            printf("No\n");
            return 0;
        }
        kq[c[i].cs] = it->second;
        b.erase(it);
    }
    printf("Yes\n");
    for (int i = 1; i < n; ++i)
        printf("%d ", kq[i]);
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>

using namespace std;

long long n, m, x, y, i, blad, px, py;
bool jest[200001];
long long w[200001];

struct punkt
{
	long long x;
	long long y;
	int i;
};
punkt p;
vector<punkt> tab, bridges;
struct punkt2
{
	long long x;
	int i;
	bool operator()( punkt2 x, punkt2 y )
	{
		if( x.x >= y.x )return 1;
		else return 0;
	}
};
punkt2 r;
priority_queue<punkt2, vector<punkt2>, punkt2> Q;
bool cmp( punkt x, punkt y )
{
	if( x.x < y.x )return 1;
	else return 0;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n>>m;
	for( int a = 1; a <= n; a++ )
	{
		cin>>x>>y;
		if( a > 1 )
		{
			p.x = x-py;
			p.y = y-px;
			p.i = a-1;
			tab.push_back(p);
		}
		px = x;
		py = y;
	}
	for( int a = 1; a <= m; a++ )
	{
		cin>>x;
		p.x = x;
		p.i = a;
		bridges.push_back( p );
	}
	sort( tab.begin(), tab.end(), cmp );
//	for( int a = 0; a < tab.size(); a++ )cout<<tab[a].x<<" "<<tab[a].y<<endl;
	sort( bridges.begin(), bridges.end(), cmp );
	for( int a = 0; a < bridges.size(); a++ )
	{
		if( n-1 > m )
		{
			blad = 1;
			break;
		}
//		cout<<a<<" "<<bridges[ a ].x<<endl;
		while( i < tab.size() && tab[ i ].x <= bridges[ a ].x )
		{
			r.x = tab[ i ].y;
			r.i = tab[ i ].i;
			Q.push( r );
			i++;
		}
		if( !Q.empty() )
		{
//			cout<<"ok";
			r = Q.top();
//			cout<<r.x<<" "<<bridges[ a ].x<<endl;
			if( r.x < bridges[ a ].x )
			{
				blad = 1;
				break;
			}
			else
			{
				w[ r.i ] = bridges[ a ].i;
				Q.pop();
			}
		}
	}
	if( blad )cout<<"No";
	else
	{
		cout<<"Yes"<<endl;
		for( int a = 1; a < n; a++ )cout<<w[a]<<" ";
	}

	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>

using namespace std;

long long n, m, x, y, i, blad, px, py;
bool jest[200001];
long long begin[200001], end[200001], w[200001];

struct punkt
{
	long long l;
	int i;
	int info;
};
punkt p;
struct punkt2
{
	int i;
	bool operator()( punkt2 x, punkt2 y )
	{
		if( end[ x.i ] >= end[ y.i ] )return 1;
		else return 0;
	}
};
punkt2 r;
priority_queue<punkt2, vector<punkt2>, punkt2> Q;
vector<punkt> tab, bridges;

bool cmp( punkt x, punkt y )
{
	if( x.l < y.l )return 1;
	else return 0;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n>>m;
	for( int a = 1; a <= n; a++ )
	{
		cin>>x>>y;
		if( a > 1 )
		{
			begin[ a - 1 ] = x-py;
			p.l = x-py;
			p.i = a-1;
			p.info = 0;
			tab.push_back(p);
			p.l = y-px;
			p.info = 1;
			tab.push_back(p);
			end[ a - 1 ] = y-px;
		}
		px = x;
		py = y;
	}
//	cout<<tab.size()<<endl;
	for( int a = 1; a <= m; a++ )
	{
		cin>>x;
		p.l = x;
		p.i = a;
		bridges.push_back(p);
	}
	sort( tab.begin(), tab.end(), cmp );
	sort( bridges.begin(), bridges.end(), cmp );
	for( int a = 0; a < tab.size(); a++ )
	{
//		cout<<tab[a].l<<endl;
		if( tab[ a ].info == 1 )
		{
			if( jest[ tab[ a ].i ] )
			{
				blad = 1;
				break;
			}
		}
		else
		{
			r.i = tab[a].i;
			Q.push( r );
			jest[ tab[a].i ] = 1;
		}
		if( a + 1 == tab.size() || tab[ a + 1 ].info == 1 || tab[ a + 1 ].l > bridges[ i ].l )
		{
			while( 1 )
			{

				if( i == m )break;
	//			cout<<"ok";
				if( Q.empty() )break;
				r = Q.top();
//				cout<<a<<" "<<begin[ r.i ]<<" "<<end[ r.i ]<<"   "<<bridges[ i ].l<<endl;
				if( begin[ r.i ] <= bridges[ i ].l && bridges[ i ].l <= end[ r.i ] )
				{

					Q.pop();
					jest[ r.i ] = 0;
					w[ r.i ] = bridges[ i ].i;
					i++;
				}
				else if( bridges[ i ].l < begin[ r.i ] )i++;
				else if( bridges[ i ].l > end[ r.i ] )break;
			}
//			if( a + 1 == tab.size() )break;
		}
//		else a++;
	}
	if( blad )cout<<"No";
	else
	{
		cout<<"Yes"<<endl;
		for( int a = 1; a < n; a++ )cout<<w[a]<<" ";
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>

using namespace std;

long long n, m, x, y, i, blad, px, py;
bool jest[200001];
long long w[200001];

struct punkt
{
	long long x;
	long long y;
	int i;
};
punkt p;
vector<punkt> tab, bridges;
struct punkt2
{
	long long x;
	int i;
	bool operator()( punkt2 x, punkt2 y )
	{
		if( x.x >= y.x )return 1;
		else return 0;
	}
};
punkt2 r;
priority_queue<punkt2, vector<punkt2>, punkt2> Q;
bool cmp( punkt x, punkt y )
{
	if( x.x < y.x )return 1;
	else return 0;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n>>m;
	for( int a = 1; a <= n; a++ )
	{
		cin>>x>>y;
		if( a > 1 )
		{
			p.x = x-py;
			p.y = y-px;
			p.i = a-1;
			tab.push_back(p);
		}
		px = x;
		py = y;
	}
	for( int a = 1; a <= m; a++ )
	{
		cin>>x;
		p.x = x;
		p.i = a;
		bridges.push_back( p );
	}
	sort( tab.begin(), tab.end(), cmp );
//	for( int a = 0; a < tab.size(); a++ )cout<<tab[a].x<<" "<<tab[a].y<<endl;
	sort( bridges.begin(), bridges.end(), cmp );
	for( int a = 0; a < bridges.size(); a++ )
	{
		if( n > m )
		{
			blad = 1;
			break;
		}
//		cout<<a<<" "<<bridges[ a ].x<<endl;
		while( i < tab.size() && tab[ i ].x <= bridges[ a ].x )
		{
			r.x = tab[ i ].y;
			r.i = tab[ i ].i;
			Q.push( r );
			i++;
		}
		if( !Q.empty() )
		{
//			cout<<"ok";
			r = Q.top();
//			cout<<r.x<<" "<<bridges[ a ].x<<endl;
			if( r.x < bridges[ a ].x )
			{
				blad = 1;
				break;
			}
			else
			{
				w[ r.i ] = bridges[ a ].i;
				Q.pop();
			}
		}
	}
	if( blad )cout<<"No";
	else
	{
		cout<<"Yes"<<endl;
		for( int a = 1; a < n; a++ )cout<<w[a]<<" ";
	}

	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>

using namespace std;

long long n, m, x, y, i, blad, px, py;
bool jest[200001];
long long begin[200001], end[200001], w[200001];

struct punkt
{
	long long l;
	int i;
	int info;
};
punkt p;
struct punkt2
{
	int i;
	bool operator()( punkt2 x, punkt2 y )
	{
		if( end[ x.i ] >= end[ y.i ] )return 1;
		else return 0;
	}
};
punkt2 r;
priority_queue<punkt2, vector<punkt2>, punkt2> Q;
vector<punkt> tab, bridges;

bool cmp( punkt x, punkt y )
{
	if( x.l < y.l )return 1;
	else return 0;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n>>m;
	for( int a = 1; a <= n; a++ )
	{
		cin>>x>>y;
		if( a > 1 )
		{
			begin[ a - 1 ] = x-py;
			p.l = x-py;
			p.i = a-1;
			p.info = 0;
			tab.push_back(p);
			p.l = y-px;
			p.info = 1;
			tab.push_back(p);
			end[ a - 1 ] = y-px;
		}
		px = x;
		py = y;
	}
//	cout<<tab.size()<<endl;
	for( int a = 1; a <= m; a++ )
	{
		cin>>x;
		p.l = x;
		p.i = a;
		bridges.push_back(p);
	}
	sort( tab.begin(), tab.end(), cmp );
	sort( bridges.begin(), bridges.end(), cmp );
	for( int a = 0; a < tab.size(); a++ )
	{
//		cout<<tab[a].l<<endl;
		if( tab[ a ].info == 1 )
		{
			if( jest[ tab[ a ].i ] )
			{
				blad = 1;
				break;
			}
		}
		else
		{
			r.i = tab[a].i;
			Q.push( r );
			jest[ tab[a].i ] = 1;
		}
		while( 1 )
		{

			if( i == m )break;
//			cout<<"ok";
			if( Q.empty() )break;
			r = Q.top();
//			cout<<begin[ r.i ]<<" "<<end[ r.i ]<<"   "<<bridges[ i ].l<<endl;
			if( begin[ r.i ] <= bridges[ i ].l && bridges[ i ].l <= end[ r.i ] )
			{

				Q.pop();
				jest[ r.i ] = 0;
				w[ r.i ] = bridges[ i ].i;
				i++;
			}
			else if( bridges[ i ].l < begin[ r.i ] )i++;
			else if( bridges[ i ].l > end[ r.i ] )break;
		}
	}
	if( blad )cout<<"No";
	else
	{
		cout<<"Yes"<<endl;
		for( int a = 1; a < n; a++ )cout<<w[a]<<" ";
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>

using namespace std;

long long n, m, x, y, i, blad, px, py;
bool jest[200001];
long long w[200001];

struct punkt
{
	long long x;
	long long y;
	int i;
};
punkt p;
vector<punkt> tab, bridges;
struct punkt2
{
	long long x;
	int i;
	bool operator()( punkt2 x, punkt2 y )
	{
		if( x.x >= y.x )return 1;
		else return 0;
	}
};
punkt2 r;
priority_queue<punkt2, vector<punkt2>, punkt2> Q;
bool cmp( punkt x, punkt y )
{
	if( x.x < y.x )return 1;
	else return 0;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n>>m;
	for( int a = 1; a <= n; a++ )
	{
		cin>>x>>y;
		if( a > 1 )
		{
			p.x = x-py;
			p.y = y-px;
			p.i = a-1;
			tab.push_back(p);
		}
		px = x;
		py = y;
	}
	for( int a = 1; a <= m; a++ )
	{
		cin>>x;
		p.x = x;
		p.i = a;
		bridges.push_back( p );
	}
	sort( tab.begin(), tab.end(), cmp );
//	for( int a = 0; a < tab.size(); a++ )cout<<tab[a].x<<" "<<tab[a].y<<endl;
	sort( bridges.begin(), bridges.end(), cmp );

	for( int a = 0; a < bridges.size(); a++ )
	{
		if( n-1 > m )
		{
			blad = 1;
			break;
		}
		if( tab[ n - 2 ].x > bridges[ m - 1 ].x )
		{
			blad = 1;
			break;
		}
//		cout<<a<<" "<<bridges[ a ].x<<endl;
		while( i < tab.size() && tab[ i ].x <= bridges[ a ].x )
		{
//			cout<<"ok";
			r.x = tab[ i ].y;
			r.i = tab[ i ].i;
			Q.push( r );
			i++;
		}
		if( !Q.empty() )
		{
//			cout<<"ok";
			r = Q.top();
//			cout<<r.x<<" "<<bridges[ a ].x<<endl;
			if( r.x < bridges[ a ].x )
			{
				blad = 1;
				break;
			}
			else
			{
				w[ r.i ] = bridges[ a ].i;
				Q.pop();
			}
		}
	}
	if( blad )cout<<"No";
	else
	{
		cout<<"Yes"<<endl;
		for( int a = 1; a < n; a++ )cout<<w[a]<<" ";
	}

	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>

using namespace std;

long long n, m, x, y, i, blad, px, py;
bool jest[200001];
long long w[200001];

struct punkt
{
	long long x;
	long long y;
	int i;
};
punkt p;
vector<punkt> tab, bridges;
struct punkt2
{
	long long x;
	int i;
	bool operator()( punkt2 x, punkt2 y )
	{
		if( x.x >= y.x )return 1;
		else return 0;
	}
};
punkt2 r;
priority_queue<punkt2, vector<punkt2>, punkt2> Q;
bool cmp( punkt x, punkt y )
{
	if( x.x < y.x )return 1;
	else return 0;
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin>>n>>m;
	for( int a = 1; a <= n; a++ )
	{
		cin>>x>>y;
		if( a > 1 )
		{
			p.x = x-py;
			p.y = y-px;
			p.i = a-1;
			tab.push_back(p);
		}
		px = x;
		py = y;
	}
	for( int a = 1; a <= m; a++ )
	{
		cin>>x;
		p.x = x;
		p.i = a;
		bridges.push_back( p );
	}
	sort( tab.begin(), tab.end(), cmp );
//	for( int a = 0; a < tab.size(); a++ )cout<<tab[a].x<<" "<<tab[a].y<<endl;
	sort( bridges.begin(), bridges.end(), cmp );
	for( int a = 0; a < bridges.size(); a++ )
	{
//		cout<<a<<" "<<bridges[ a ].x<<endl;
		while( i < tab.size() && tab[ i ].x <= bridges[ a ].x )
		{
			r.x = tab[ i ].y;
			r.i = tab[ i ].i;
			Q.push( r );
			i++;
		}
		if( !Q.empty() )
		{
//			cout<<"ok";
			r = Q.top();
//			cout<<r.x<<" "<<bridges[ a ].x<<endl;
			if( r.x < bridges[ a ].x )
			{
				blad = 1;
				break;
			}
			else
			{
				w[ r.i ] = bridges[ a ].i;
				Q.pop();
			}
		}
	}
	if( blad )cout<<"No";
	else
	{
		cout<<"Yes"<<endl;
		for( int a = 1; a < n; a++ )cout<<w[a]<<" ";
	}

	return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <string.h>
#include <map>
#include <queue>
#include <algorithm>
#include <math.h>
#include <set>
#include <strstream>

using namespace std;

#define N 400005
#define NN 200005
#define P 1005
#define INF  0x3f3f3f3f
#define LL  long long
#define MOD 1000000007

#define eps 1e-9

#define MID ((l + r)/2)
#define lx (x<<1)
#define rx ((x<<1)|1)

struct Node{
    LL sm,bi;
    int id;
};

Node node[N];
LL l[N],r[N];

struct Bridge{
    LL len;
    int id;
    Bridge(){}
    Bridge(LL _len,int _id){len=_len;id=_id;}
    bool operator < (const Bridge & other) const{
        return len < other.len || (len == other.len  && id < other.id);
    }
};

bool cmp(Node a,Node b){
    return a.bi < b.bi;
}

struct Query{
    int ans;
    int id;
    Query(){}
    Query(int _ans,int _id){
        ans = _ans;id = _id;
    }
    bool operator < (const Query & other) const{
        return id < other.id;
    }
};

int main(){
    //freopen("in.txt","r",stdin);
    int n,m;
    LL tmp;
    while(cin>>n>>m){
        for(int i=0;i<n;i++){
            cin>>l[i]>>r[i];
        }
        int cnt = 0;
        for(int i=1;i<n;i++){
            node[cnt].sm = l[i] - r[i-1];
            node[cnt].bi = r[i] - l[i-1];
            node[cnt].id = i;
            cnt++;
        }
        sort(node,node+cnt,cmp);
        set<Bridge> ss;
        for(int i=0;i<m;i++){
            cin>>tmp;
            ss.insert(Bridge(tmp,i));
        }
        bool flag = 0;
        vector<Query> res;
        for(int i=0;i<cnt;i++){
            set<Bridge>::iterator it = ss.lower_bound( Bridge(node[i].sm,-1) );
            if(it == ss.end() || (*it).len > node[i].bi  ){
                flag = 1;
                break;
            }
            else{
                ss.erase(it);
                res.push_back( Query( (*it).id + 1, node[i].id ) );
            }
        }
        if(flag){
            puts("No");
        }
        else{
            puts("Yes");
            sort(res.begin(),res.end());
            for(int i=0;i<res.size();i++){
                printf("%d ",res[i].ans );
            }
            puts("");
        }
    }

    return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <string.h>
#include <map>
#include <queue>
#include <algorithm>
#include <math.h>
#include <set>
#include <strstream>

using namespace std;

#define N 400005
#define NN 200005
#define P 1005
#define INF  0x3f3f3f3f
#define LL  long long
#define MOD 1000000007

#define eps 1e-9

#define MID ((l + r)/2)
#define lx (x<<1)
#define rx ((x<<1)|1)

struct Node{
    LL sm,bi;
    int id;
};

Node node[N];
LL l[N],r[N];

struct Bridge{
    LL len;
    int id;
    Bridge(){}
    Bridge(LL _len,int _id){len=_len;id=_id;}
    bool operator < (const Bridge & other) const{
        return len < other.len || (len == other.len  && id < other.id);
    }
};

bool cmp(Node a,Node b){
    return a.bi < b.bi;
}

struct Query{
    int ans;
    int id;
    Query(){}
    Query(int _ans,int _id){
        ans = _ans;id = _id;
    }
    bool operator < (const Query & other) const{
        return id < other.id;
    }
};

set<Bridge> ss;
vector<Query> res;

int main(){
    //freopen("in.txt","r",stdin);
    int n,m;
    LL tmp;
    while(cin>>n>>m){
        for(int i=0;i<n;i++){
            cin>>l[i]>>r[i];
        }
        int cnt = 0;
        for(int i=1;i<n;i++){
            node[cnt].sm = l[i] - r[i-1];
            node[cnt].bi = r[i] - l[i-1];
            node[cnt].id = i;
            cnt++;
        }
        sort(node,node+cnt,cmp);
        ss.clear();
        for(int i=0;i<m;i++){
            cin>>tmp;
            ss.insert(Bridge(tmp,i));
        }
        bool flag = 0;
        res.clear();
        for(int i=0;i<cnt;i++){
            set<Bridge>::iterator it = ss.lower_bound( Bridge(node[i].sm,-1) );
            if(it == ss.end() || (*it).len > node[i].bi  ){
                flag = 1;
                break;
            }
            else{
                ss.erase(it);
                res.push_back( Query( (*it).id + 1, node[i].id ) );
            }
        }
        if(flag){
            puts("No");
        }
        else{
            puts("Yes");
            sort(res.begin(),res.end());
            for(int i=0;i<n-1;i++){
                printf("%d ",res[i].ans );
            }
            puts("");
        }
    }

    return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <string.h>
#include <map>
#include <queue>
#include <algorithm>
#include <math.h>
#include <set>
#include <strstream>

using namespace std;

#define N 400005
#define NN 200005
#define P 1005
#define INF  0x3f3f3f3f
#define LL  long long
#define MOD 1000000007

#define eps 1e-9

#define MID ((l + r)/2)
#define lx (x<<1)
#define rx ((x<<1)|1)

struct Node{
    LL sm,bi;
    int id;
};

Node node[N];
LL l[N],r[N];

struct Bridge{
    LL len;
    int id;
    Bridge(){}
    Bridge(LL _len,int _id){len=_len;id=_id;}
    bool operator < (const Bridge & other) const{
        return len < other.len || (len == other.len  && id < other.id);
    }
};

bool cmp(Node a,Node b){
    return a.bi < b.bi;
}

struct Query{
    int ans;
    int id;
    Query(){}
    Query(int _ans,int _id){
        ans = _ans;id = _id;
    }
    bool operator < (const Query & other) const{
        return id < other.id;
    }
};

int main(){
    //freopen("in.txt","r",stdin);
    int n,m;
    LL tmp;
    while(cin>>n>>m){
        for(int i=0;i<n;i++){
            cin>>l[i]>>r[i];
        }
        int cnt = 0;
        for(int i=1;i<n;i++){
            node[cnt].sm = l[i] - r[i-1];
            node[cnt].bi = r[i] - l[i-1];
            node[cnt].id = i;
            cnt++;
        }
        sort(node,node+cnt,cmp);
        set<Bridge> ss;
        for(int i=0;i<m;i++){
            cin>>tmp;
            ss.insert(Bridge(tmp,i));
        }
        bool flag = 0;
        vector<Query> res;
        for(int i=0;i<cnt;i++){
            set<Bridge>::iterator it = ss.lower_bound( Bridge(node[i].sm,-1) );
            if(it == ss.end() || (*it).len > node[i].bi  ){
                flag = 1;
                break;
            }
            else{
                ss.erase(it);
                res.push_back( Query( (*it).id + 1, node[i].id ) );
            }
        }
        if(flag){
            puts("No");
        }
        else{
            puts("Yes");
            sort(res.begin(),res.end());
            for(int i=0;i<n-1;i++){
                printf("%d ",res[i].ans );
            }
            puts("");
        }
    }

    return 0;
}


#include <stdio.h>
#include <iostream>
#include <vector>
#include <string.h>
#include <map>
#include <queue>
#include <algorithm>
#include <math.h>
#include <set>
#include <strstream>

using namespace std;

#define N 4000005
#define NN 200005
#define P 1005
#define INF  0x3f3f3f3f
#define LL  long long
#define MOD 1000000007

#define eps 1e-9

#define MID ((l + r)/2)
#define lx (x<<1)
#define rx ((x<<1)|1)

struct Node{
    LL sm,bi;
    int id;
};

Node node[N];
LL l[N],r[N];

struct Bridge{
    LL len;
    int id;
    Bridge(){}
    Bridge(LL _len,int _id){len=_len;id=_id;}
    bool operator < (const Bridge & other) const{
        return len < other.len || (len == other.len  && id < other.id);
    }
};

bool cmp(Node a,Node b){
    return a.bi < b.bi;
}

struct Query{
    int ans;
    int id;
    Query(){}
    Query(int _ans,int _id){
        ans = _ans;id = _id;
    }
    bool operator < (const Query & other) const{
        return id < other.id;
    }
};

set<Bridge> ss;
vector<Query> res;

int main(){
    //freopen("in.txt","r",stdin);
    int n,m;
    LL tmp;
    while(cin>>n>>m){
        for(int i=0;i<n;i++){
            cin>>l[i]>>r[i];
        }
        int cnt = 0;
        for(int i=1;i<n;i++){
            node[cnt].sm = l[i] - r[i-1];
            node[cnt].bi = r[i] - l[i-1];
            node[cnt].id = i;
            cnt++;
        }
        sort(node,node+cnt,cmp);
        ss.clear();
        for(int i=0;i<m;i++){
            cin>>tmp;
            ss.insert(Bridge(tmp,i));
        }
        bool flag = 0;
        res.clear();
        for(int i=0;i<cnt;i++){
            set<Bridge>::iterator it = ss.lower_bound( Bridge(node[i].sm,-1) );
            if(it == ss.end() || (*it).len > node[i].bi  ){
                flag = 1;
                break;
            }
            else{
                res.push_back( Query( (*it).id + 1, node[i].id ) );
                ss.erase(it);
            }
        }
        if(flag){
            puts("No");
        }
        else{
            puts("Yes");
            sort(res.begin(),res.end());
            for(int i=0;i<n-1;i++){
                printf("%d ",res[i].ans );
            }
            puts("");
        }
    }

    return 0;
}


#include <iostream>
#include <algorithm>
#include <set>
#include <utility>
using namespace std;
const long long int maxix = 100*1000*2+10;
pair < long long int , pair <long long int,long long int> > arr[maxix];
pair <long long int,long long int> brr[maxix];
long long int ans[maxix];
multiset <long long int> bridg;
multiset <long long int>::iterator it;
multiset <long long int>::iterator it2;
int main()
{

    long long int n, m;
    long long int x;
    cin >> n >> m;
    for (long long int i=0 ; i<n ; i++)
        cin >> brr[i].first >> brr[i].second;
    for (long long int i=0 ; i<n-1 ; i++)
    {
        arr[i].first = brr[i+1].second - brr[i].first;
        arr[i].second.first = brr[i+1].first - brr[i].second;
        arr[i].second.second = i;
    }
    for (long long int i=0 ; i<m ; i++)
    {

        cin >> x;
        brr[i].first = x;
        brr[i].second = i;
        bridg.insert(x);

    }
    sort(arr,arr+n-1);
    sort(brr,brr+m);
    for (long long int i=0 ; i<n-1 ; i++)
    {
        it = bridg.lower_bound(arr[i].second.first);
        long long int now = *it;
        if (now <= arr[i].first)
        {
            ans[arr[i].second.second] = now;
            it2 = bridg.find(now);
            bridg.erase(it2);
        }
        else
            ans[arr[i].second.second] = -1;
    }

    long long int index = 0;
    long long int mid, l, r;
    for (int i=0 ; i<n-1 ; i++)
    {
        l = -1;
        r = m;
        int chlog = 0;
        while(r - l > 1 && chlog == 0)
        {
            mid = (l+r) / 2;
            if (ans[i] == brr[mid].first && ans[i] != -1 && brr[mid].second != -5)
            {
                arr[index].first = brr[mid].second;
                brr[mid].second = -5;
                index++;
                chlog = 1;
            }
            else if (ans[i] > brr[mid].first)
                l = mid;
            else
                r = mid;
        }

    }
    if (index == n-1)
    {
        cout << "Yes" << "\n";
        for (long long int i=0 ; i<index ; i++)
            cout << arr[i].first + 1 << " ";
    }
    else
        cout << "No";
   return 0;
}


#include <iostream>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
const long long int maxix = 100*1000*2+10;
pair < long long int , pair <long long int,long long int> > arr[maxix];
long long int ans[maxix];
multiset <long long int> bridg;
multiset <long long int>::iterator it;
multimap <long long int,long long int> mp;
multimap <long long int,long long int>::iterator itmp;
int main()
{

    long long int n, m;
    long long int x;
    cin >> n >> m;
    if (m < n-1)
        cout << "No";
    else
    {
        long long int x1, x2, y1, y2;
        cin >> x1 >> y1;
        for (long long int i=0 ; i<n-1 ; i++)
        {
            cin >> x2 >> y2;
            arr[i].first = y2 - x1;
            arr[i].second.first = x2 - y1;
            arr[i].second.second = i;
            x1 = x2;
            y1 = y2;
        }
        for (long long int i=0 ; i<m ; i++)
        {

            cin >> x;
            mp.insert(pair <long long int,long long int> (x,i));
            bridg.insert(x);

        }

        m = 0;
        sort(arr,arr+n-1);
        for (long long int i=0 ; i<n-1 ; i++)
        {
            long long int now;
            it = bridg.lower_bound(1);
            now = *it;
            if (arr[i].second.first > now)
                m = 1;

            it = bridg.lower_bound(arr[i].second.first);
            now = *it;

            if (now <= arr[i].first)
            {
                ans[arr[i].second.second] = now;
                it = bridg.find(now);
                bridg.erase(it);
            }
            else
                m = 1;
        }

        if (m == 1)
            cout << "No";
        else
        {
            cout << "Yes" << "\n";
            for (long long int i=0 ; i<n-1 ; i++)
            {
                itmp = mp.find(ans[i]);
                cout << itmp->second + 1 << " ";
                mp.erase(itmp);

            }
        }
    }
   return 0;
}


#include <iostream>
#include <algorithm>
#include <set>
#include <utility>
using namespace std;
const long long int maxix = 100*1000*2+10;
pair < long long int , pair <long long int,long long int> > arr[maxix];
pair <long long int,long long int> brr[maxix];
long long int ans[maxix];
multiset <long long int> bridg;
multiset <long long int>::iterator it;
multiset <long long int>::iterator it2;
int main()
{

    long long int n, m;
    long long int x;
    cin >> n >> m;
    if (m < n-1)
        cout << "No";
    else
    {
        for (long long int i=0 ; i<n ; i++)
            cin >> brr[i].first >> brr[i].second;
        for (long long int i=0 ; i<n-1 ; i++)
        {
            arr[i].first = brr[i+1].second - brr[i].first;
            arr[i].second.first = brr[i+1].first - brr[i].second;
            arr[i].second.second = i;
        }
        for (long long int i=0 ; i<m ; i++)
        {

            cin >> x;
            brr[i].first = x;
            brr[i].second = i;
                bridg.insert(x);

        }
        sort(arr,arr+n-1);
        sort(brr,brr+m);
        for (long long int i=0 ; i<n-1 ; i++)
        {
            it = bridg.lower_bound(arr[i].second.first);
            long long int now = *it;
            if (now <= arr[i].first)
            {
                ans[arr[i].second.second] = now;
                it2 = bridg.find(now);
                bridg.erase(it2);
            }
            else
                ans[arr[i].second.second] = -1;
        }

        long long int index = 0;
        long long int mid, l, r;
        for (int i=0 ; i<n-1 ; i++)
        {
            l = -1;
            r = m;
            int chlog = 0;
            while(r - l > 1 && chlog == 0)
            {
                int lp = 0;
                mid = (l+r) / 2;
                if (brr[mid].second == -5 && ans[i] == brr[mid].first)
                    lp = 1;
                if (lp == 1)
                {
                    if (brr[mid].first == brr[mid+1].first)
                        l = mid;
                    else
                        r = mid;

                }
                else
                {if (ans[i] == brr[mid].first && ans[i] != -1 && brr[mid].second != -5)
                {
                    arr[index].first = brr[mid].second;
                    brr[mid].second = -5;
                    index++;
                    chlog = 1;
                }

                else if (ans[i] >= brr[mid].first)
                    l = mid;
                else
                    r = mid;
                }
            }

        }
        if (index == n-1)
        {
            cout << "Yes" << "\n";
            for (long long int i=0 ; i<index ; i++)
                cout << arr[i].first + 1 << " ";
        }
        else
            cout << "No";
    }
   return 0;
}


#include <iostream>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
const long long int maxix = 100*1000*2+10;
pair < long long int , pair <long long int,long long int> > arr[maxix];
long long int ans[maxix];
multiset <long long int> bridg;
multiset <long long int>::iterator it;
multimap <long long int,long long int> mp;
multimap <long long int,long long int>::iterator itmp;
int main()
{

    long long int n, m;
    long long int x;
    cin >> n >> m;
    if (m < n-1)
        cout << "No";
    else
    {
        long long int x1, x2, y1, y2;
        cin >> x1 >> y1;
        for (long long int i=0 ; i<n-1 ; i++)
        {
            cin >> x2 >> y2;
            arr[i].first = y2 - x1;
            arr[i].second.first = x2 - y1;
            arr[i].second.second = i;
            x1 = x2;
            y1 = y2;
        }
        for (long long int i=0 ; i<m ; i++)
        {

            cin >> x;
            mp.insert(pair <long long int,long long int> (x,i));
            bridg.insert(x);

        }

        m = 0;
        sort(arr,arr+n-1);
        for (long long int i=0 ; i<n-1 ; i++)
        {
            long long int now;
            it = bridg.lower_bound(1);
            if (*it == 1 && arr[i].second.first > 1)
                m = 1;

            it = bridg.lower_bound(arr[i].second.first);
            now = *it;
            if (now <= arr[i].first)
            {
                ans[arr[i].second.second] = now;
                it = bridg.find(now);
                bridg.erase(it);
            }
            else
                m = 1;
        }

        if (m == 1)
            cout << "No";
        else
        {
            cout << "Yes" << "\n";
            for (long long int i=0 ; i<n-1 ; i++)
            {
                itmp = mp.find(ans[i]);
                cout << itmp->second + 1 << " ";
                mp.erase(itmp);

            }
        }
    }
   return 0;
}