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.
import bisect
n, m = list(map(int, input().split()))
s = []
s1 = []
for _ in range(n):
    s.append(list(map(int, input().split())))
    if _ > 0:
        s1.append([s[-1][1] - s[-2][0], s[-1][0] - s[-2][1], _ - 1,])
a = [[int(n), i] for i, n in enumerate(input().split())]
a.sort()

def func():
    p = [[set(), set()] for i in range(len(a))]
    res = [0 for i in range(len(s1))]
    for i, j, k in s1:
        left = bisect.bisect_left(a, [j, -1])
        right = bisect.bisect_right(a, [i, float("inf")]) - 1
        if left == len(a):
            print("NO")
            return
        p[left][0].add(k)
        p[right][1].add(k)
    t = set()
    k = 0
    for i, (left, right) in enumerate(p):
        t |= left
        k += 1
        c = t & right
        if len(c) > k:
            print("NO")
            return 
        z = i - k + 1
        for x, y in enumerate(c):
            res[y] = z + x
        k -= len(c)
        t ^= right
    if len(t) > k:
        print("NO")
        return
    z = i - k
    for x, y in enumerate(t):
        res[y] = z + x
    print("YES")
    print(*res)
    
func()