#include <bits/stdc++.h>   using namespace std;   const int N = 2e5;   const int INF = 0x3f3f3f3f;   const long long LIM = 4e14;   const int mod = 1e9 + 7;   int n, m, ans[N + 10];   long long l[N + 10], r[N + 10];   struct Node {     int idx;     long long l, r;     bool friend operator<(Node c, Node d) { return !(c.r < d.r); }   } p[N + 10];   bool cmp1(Node c, Node d) {     if (c.l != d.l) return c.l < d.l;     return c.r < d.r;   }   struct Point {     int idx;     long long len;   } v[N + 10];   bool cmp2(Point c, Point d) {     if (c.len != d.len) return c.len < d.len;     return c.idx < d.idx;   }   priority_queue<Node> que;   int main() {     ios::sync_with_stdio(0);     cin.tie(0), cout.tie(0);     cin >> n >> m;     for (int i = 1; i <= n; i++) {       cin >> l[i] >> r[i];       if (i == 1) continue;       p[i - 1] = {i - 1, l[i] - r[i - 1], r[i] - l[i - 1]};     }     sort(p + 1, p + n, cmp1);     for (int i = 1; i <= m; i++) {       cin >> v[i].len;       v[i].idx = i;     }     sort(v + 1, v + 1 + m, cmp2);     int pos = 1;     for (int i = 1; i <= m; i++) {       while (pos < n && p[pos].l <= v[i].len) que.push(p[pos++]);       if (!que.empty()) {         Node c = que.top();         que.pop();         if (c.r < v[i].len) {           cout <<  No ;           return 0;         }         ans[c.idx] = v[i].idx;       }     }     int flag = 1;     for (int i = 1; i < n; i++)       if (!ans[i]) flag = 0;     if (!flag) {       cout <<  No ;       return 0;     }     cout <<  Yes n ;     for (int i = 1; i < n; i++) cout << ans[i] <<    ;     return 0;   }   