Andrewid the Android is a galaxy-famous detective. He is now chasing a criminal hiding on the planet Oxa-5, the planet almost fully covered with water.

The only dry land there is an archipelago of *n* narrow islands located in a row. For more comfort let's represent them as non-intersecting segments on a straight line: island *i* has coordinates [*l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub>], besides, *r*<sub class="lower-index">*i*</sub> &lt; *l*<sub class="lower-index">*i* + 1</sub> for 1 ≤ *i* ≤ *n* - 1.

To reach the goal, Andrewid needs to place a bridge between each pair of adjacent islands. A bridge of length *a* can be placed between the *i*-th and the (*i* + 1)-th islads, if there are such coordinates of *x* and *y*, that *l*<sub class="lower-index">*i*</sub> ≤ *x* ≤ *r*<sub class="lower-index">*i*</sub>, *l*<sub class="lower-index">*i* + 1</sub> ≤ *y* ≤ *r*<sub class="lower-index">*i* + 1</sub> and *y* - *x* = *a*. 

The detective was supplied with *m* bridges, each bridge can be used at most once. Help him determine whether the bridges he got are enough to connect each pair of adjacent islands.
The first line contains integers *n* (2 ≤ *n* ≤ 2·10<sup class="upper-index">5</sup>) and *m* (1 ≤ *m* ≤ 2·10<sup class="upper-index">5</sup>) — the number of islands and bridges.

Next *n* lines each contain two integers *l*<sub class="lower-index">*i*</sub> and *r*<sub class="lower-index">*i*</sub> (1 ≤ *l*<sub class="lower-index">*i*</sub> ≤ *r*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">18</sup>) — the coordinates of the island endpoints.

The last line contains *m* integer numbers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*m*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">18</sup>) — the lengths of the bridges that Andrewid got.
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <vector>

using namespace std;

struct dist_ord {
    long long dist;
    long long maxdist;
    int ord;
};

struct bridge_ord {
    long long bridge;
    int ord;
    bool used;
};

struct bridge_dist {
    int bridge_ind;
    int dist_ind;
};

bool operator<( const bridge_dist& c1, const bridge_dist& c2) {
    return c1.dist_ind < c2.dist_ind;
}

bool operator<( const bridge_ord& c1, const bridge_ord& c2 ) {
    return c1.bridge > c2.bridge;
}

bool operator<( const dist_ord& c1, const dist_ord& c2 ) {
    return c1.dist > c2.dist;
}

int main() {
    int n = 0, m = 0;
    scanf("%d %d", &n, &m);
    vector<dist_ord> dists;
    vector<bridge_ord> bridges;
    if (n - 1 > m) {
        cout << "No";
        return 0;
    }

    long long tempa = 0, tempb = 0;
    cin >> tempa >> tempb;
    //scanf("%I64d %I64d", &tempa, &tempb);

    for (int i = 1; i < n; ++i) {
        long long a = 0, b = 0;
        cin >> a >> b;
        //scanf("%I64d %I64d", &a, &b);
        dist_ord dio;
        dio.dist = a - tempb;
        dio.maxdist = b - tempa;
        tempa = a;
        tempb = b;
        dio.ord = i + 1;
        dists.push_back(dio);
    }
    for (int i = 0; i < m; ++i) {
        long long a = 0;
        cin >> a;
        //scanf("%I64d", &a);
        bridge_ord bo;
        bo.bridge = a;
        bo.ord = i + 1;
        bo.used = false;
        bridges.push_back(bo);
    }
    sort(dists.begin(), dists.end());
    //cout << "sorted 1: " << endl;
    for (auto dist : dists) {
        //cout << dist.dist << ' ' << dist.ord << endl;
    }
    sort(bridges.begin(), bridges.end());
    //cout << "sorted 2: " << endl;
    for (auto bridge : bridges) {
        //cout << bridge.bridge << ' ' << bridge.ord << endl;
    }
    //cout << endl << endl;
    int bridgesAvailable = m;
    int distsUncovered = n - 1;
    int curBridge = 0;
    vector<bridge_dist> indexes;
    int num = 0;
    for (auto elem : dists) {
        num++;
        curBridge = 0;
        while (elem.dist > bridges[curBridge].bridge || elem.maxdist < bridges[curBridge].bridge || bridges[curBridge].used == true) {
            //cout << "test1: " << elem.maxdist << ' ' << bridges[curBridge].bridge << endl;
            curBridge++;
            //cout << "test2: " << elem.maxdist << ' ' << bridges[curBridge].bridge << endl;
            if (curBridge >= m) {
                cout << "No";
                return 0;
            }
        }
        bridgesAvailable--;
        //cout << bridges[curBridge].bridge << ' ' << bridges[curBridge].ord << endl;
        bridges[curBridge].used = true;
        if (bridgesAvailable < distsUncovered) {
            //cout << "first" << endl;
            cout << "No";
            return 0;
        }
        //cout << "num: " << num << endl;
        if (elem.maxdist < bridges[curBridge].bridge) {
            //cout << elem.dist << ' ' << elem.maxdist << ' ' <<  bridges[curBridge].bridge << endl;
            //cout << "second" << endl;
            cout << "No";
            return 0;
        }
        bridge_dist bd;
        bd.bridge_ind = bridges[curBridge++].ord;
        bd.dist_ind = elem.ord;
        indexes.push_back(bd);
        distsUncovered--;
    }
    cout << "Yes\n";
    //cout << "indexes size: " << indexes.size() << endl;
    sort(indexes.begin(), indexes.end());
    for (auto ind : indexes) {
        cout << ind.bridge_ind << ' ';
    }
    return 0;
}
