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.
'''
https://codeforces.com/problemset/problem/555/B

输入 n(2≤n≤2e5) 和 m(1≤m≤2e5)，然后输入 n 行，每行有两个数，表示一个闭区间（1≤L≤R≤1e18），然后输入一个长为 m 的数组 a (1≤a[i]≤1e18)。输入保证区间之间没有交集，且上一个区间的右端点小于下一个区间的左端点。

你有 m 座桥，每座桥的长为 a[i]，你需要选择 n-1 座桥连接所有相邻的区间。
要求桥的两个端点分别落在这两个闭区间内（这两个端点的差等于桥长）。

如果无法做到，输出 No；否则输出 Yes，然后按顺序输出这 n-1 座桥的编号（编号从 1 开始），输出的第一座桥连接第一个区间和第二个区间，输出的第二座桥连接第二个区间和第三个区间，依此类推。

思考：如果不要求连接的两个区间相邻，你能否连通所有区间？

本题算作区间与点的最大匹配/覆盖问题
类似的还有 https://www.luogu.com.cn/problem/P2887
输入
4 4
1 4
7 8
9 10
12 14
4 5 3 8
输出
Yes
2 3 1

输入
2 2
11 14
17 18
2 9
输出
No

输入
2 1
1 1
1000000000000000000 1000000000000000000
999999999999999999
输出
Yes
1
'''
from itertools import *
from collections import *
from math import *
from heapq import *
from functools import *
from bisect import *
from random import *
import sys
from typing import List


def solve():
    n, m = map(int, input().split())
    arr = []
    for _ in range(n):
        u, v = map(int, input().split())
        arr.append((u, v))
    a = list(map(int, input().split()))

    heap = []
    for i in range(n - 1):
        l1, r1 = arr[i]
        l2, r2 = arr[i + 1]
        minv, maxv = l2 - r1, r2 - l1
        heappush(heap, (minv, maxv, i))

    a = sorted([(i, v) for i, v in enumerate(a)], key=lambda x: x[1])
    res = [0] * (n - 1)
    for i,v in a:
        if heap and heap[0][0] > v: continue
        if heap and v > heap[0][1]:
            print("NO")
            return
        if heap:
            minv, maxv, j = heappop(heap)
            res[j] = i+1
    if heap:
        print("NO")
    else:
        print("YES")
        for v in res:
            print(v,end=' ')


solve()
