Little X has n distinct integers: p1, p2, ..., pn. He wants to divide all of them into two sets A and B. The following two conditions must be satisfied:

  * If number x belongs to set A, then number a - x must also belong to set A. 
  * If number x belongs to set B, then number b - x must also belong to set B. 



Help Little X divide the numbers into two sets or determine that it's impossible.

Input

The first line contains three space-separated integers n, a, b (1 ≤ n ≤ 105; 1 ≤ a, b ≤ 109). The next line contains n space-separated distinct integers p1, p2, ..., pn (1 ≤ pi ≤ 109).

Output

If there is a way to divide the numbers into two sets, then print "YES" in the first line. Then print n integers: b1, b2, ..., bn (bi equals either 0, or 1), describing the division. If bi equals to 0, then pi belongs to set A, otherwise it belongs to set B.

If it's impossible, print "NO" (without the quotes).

Examples

Input

4 5 9
2 3 4 5


Output

YES
0 0 1 1


Input

3 3 4
1 2 4


Output

NO

Note

It's OK if all the numbers are in the same set, and the other one is empty.
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.math.BigInteger;
import java.util.*;
import java.io.InputStream;

public class SolC {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskSolver solver = new TaskSolver();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskSolver {

    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] p = new int[n];

        /*The thought is x, a-x, b-x must be in the same set.*/
        Map<Integer, Integer> alloc_map = new HashMap<Integer, Integer>();
        Map<Integer, Integer> idxToVal = new HashMap<Integer, Integer>();

        int i = 0;
        for (i = 0; i < n; ++i) {
            p[i] = in.nextInt();
            alloc_map.put(p[i], -1);
            idxToVal.put(i,p[i]);
        }

        Arrays.sort(p);
        //0 for a, 1 for b
        for (i = 0; i < n; ++i){
            if(arrangeNum(p[i], 0, a, b, alloc_map))
                continue;
            if(arrangeNum(p[i], 1, a, b, alloc_map))
                continue;
            out.println("NO");
            return;
        }

        out.println("YES");
        for (i = 0; i < n; ++i){
            out.print(alloc_map.get(idxToVal.get(i))+" ");
        }
    }

    /*
    put the num into set "set_num"
    */
    private boolean arrangeNum(int num, int set_num, int a, int b, Map<Integer, Integer> alloc_map){
        if(!alloc_map.containsKey(num))//does not exist
            return true;
        int set = alloc_map.get(num);
        if(set >= 0){//already allocated
            if(set == set_num)
                return true;
            else
                return false;
        }

        //not allocated
        //decides if result exists
        if(set_num == 0 && !alloc_map.containsKey(a - num))
            return false;
        if(set_num == 1 && !alloc_map.containsKey(b - num))
            return false;
        //try to allocate
        alloc_map.put(num, set_num);
        if(arrangeNum(a - num, set_num, a, b, alloc_map) && arrangeNum(b - num, set_num, a, b, alloc_map))
            return true;
        alloc_map.put(num, -1);
        return false;
    }
}

/*
    int in.nextInt()
    String in.nextString()

    out.print(n + " ") //must be " " which is a String object.
    out.close()
*/
class InputReader {
    InputStream stream;
    byte[] buf = new byte[1024];
    int curChar, numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    private int read() {

        if (numChars == -1)
            throw new InputMismatchException();
        //buffer wraps around here. Hence the buf array size does not matter.
        /*
        if the buffer size is enough, i.e 1024. InputStream load at most 1024 bytes(if necessary)
        into buffer. read() returns 1 byte every time. After the first read, it only needs to
        return corresponding byte in the buf every time it is called. it does not have to call
        input stream to read again.
        Only if the bug has run out does InputReader has to call stream.read(buf) to reload the
        buf.
        */
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }


    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    private boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void println(Object... objects){
        print(objects);
        print("\n");
    }

    public void close() {
        writer.close();
    }

}