Problem: Robot Bender decided to make Fray a birthday present. He drove n nails and numbered them from 1 to n in some order. Bender decided to make a picture using metal rods. The picture is a closed polyline, which vertices should be nails (in the given order). The segments of the polyline should be parallel to the coordinate axes. Polyline is allowed to have self-intersections. Bender can take a rod and fold it exactly once in any place to form an angle of 90 degrees. Then he can attach the place of the fold to some unoccupied nail and attach two ends of this rod to adjacent nails. A nail is considered unoccupied if there is no rod attached to it (neither by it's end nor the by the fold place). No rod could be used twice. It is not required to use all the rods.

Help Bender to solve this difficult task.

Input

The first line contains two positive integers n and m (4 ≤ n ≤ 500, 2 ≤ m ≤ 500, n is even) — the amount of nails and the amount of rods. i-th of the following n lines contains a pair of integers, denoting the coordinates of the i-th nail. Nails should be connected in the same order as they are given in the input. The last line contains m integers — the lenghts of the rods. All coordinates do not exceed 104 by absolute value. Lengths of the rods are between 1 and 200 000. No rod can be used twice. It is guaranteed that all segments of the given polyline are parallel to coordinate axes. No three consecutive nails lie on the same line.

Output

If it is impossible to solve Bender's problem, output NO. Otherwise, output YES in the first line, and in the second line output n numbers — i-th of them should be the number of rod, which fold place is attached to the i-th nail, or -1, if there is no such rod.

If there are multiple solutions, print any of them.

Examples

Input

4 2
0 0
0 2
2 2
2 0
4 4


Output

YES
1 -1 2 -1 


Input

6 3
0 0
1 0
1 1
2 1
2 2
0 2
3 2 3


Output

YES
1 -1 2 -1 3 -1 


Input

6 3
0 0
1 0
1 1
2 1
2 2
0 2
2 2 3


Output

NO

Solution (in JAVA):

Solution:


import java.util.*;

public class T1 {

    static void metod() throws Exception {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();

        int[] x = new int[n];
        int[] y = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
        }

        int[] a1 = new int[n];
        for (int i = 0; i < n; i++) {
            a1[i] = -1;
        }

        int[] a2 = new int[n];
        for (int i = 0; i < n; i++) {
            a2[i] = -1;
        }

        int[] p2 = new int[m];
        int[] p = new int[m];
        for (int i = 0; i < m; i++) {
            int h = in.nextInt();
            p[i] = h;
            p2[i] = h;
        }

        int[] s = new int[n];
        for (int i = 0; i < n - 1; i++) {
            s[i] = Math.max(Math.abs(x[i] - x[i + 1]),
                    Math.abs(y[i] - y[i + 1]));
        }
        s[n - 1] = Math.max(Math.abs(x[n - 1] - x[0]),
                Math.abs(y[n - 1] - y[0]));

        int[] s1 = new int[n / 2];
        for (int i = 0; i < n - 1; i += 2) {
            s1[i / 2] = s[i] + s[i + 1];
        }

        int[] s2 = new int[n / 2];
        for (int i = 1; i < n - 2; i += 2) {
            s2[(i - 1) / 2] = s[i] + s[i + 1];
        }
        s2[n / 2 - 1] = s[n - 1] + s[0];

        boolean t1 = true;
        boolean t2 = true;
        
        

        for (int k = 0; k < n / 2; k++) {           
            
            int sm = s1[0];
            int smi = 0;
            for (int i = 0; i < n / 2; i++) {
                if (s1[i] > sm) {
                    sm = s1[i];// get max s1[]
                    smi = i;
                }
            }
            
            int m1i = -1;
            for (int i = 0; i < m; i++) {
                if (p[i] == s1[smi]) {
                    m1i = i;
                    break;
                }
            }
            s1[smi] = -1;           
            
            if (m1i == -1) {
                t1 = false;
                break;
            } else {
                p[m1i] = -2;                
                a1[2 * smi + 1] = m1i + 1;              
            }
        }
        
        if (t1) {
            System.out.println("YES");
            for (int i = 0; i < n; i++) {
                System.out.print(a1[i] + " ");
            }
        } else {

            for (int k = 0; k < n / 2; k++) {           
                
                int sm = s2[0];
                int smi = 0;
                for (int i = 0; i < n / 2; i++) {
                    if (s2[i] > sm) {
                        sm = s2[i];// get max s2[]
                        smi = i;
                    }
                }
                
                int m1i = -1;
                for (int i = 0; i < m; i++) {
                    if (p2[i] == s2[smi]) {
                        m1i = i;
                        break;
                    }
                }
                s2[smi] = -1;           
                
                if (m1i == -1) {
                    t2 = false;
                    break;
                } else {
                    if (smi == n / 2 - 1) {
                        a2[0] = m1i + 1;
                    } else {
                        a2[2 * smi + 2] = m1i + 1;
                    }
                    p2[m1i] = -2;                                   
                }
            }

            if (t2) {
                System.out.println("YES");
                for (int i = 0; i < n; i++) {
                    System.out.print(a2[i] + " ");
                }
            } else {
                System.out.println("NO");
            }

        }

    }

    public static void main(String args[]) throws Exception {
        T1.metod();
    }
}