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.*;
import java.util.*;

public class d {
    private static StringTokenizer st;
    private static BufferedReader br;
    public static long MOD = 1000000007;

    public static void print(Object x) {
        System.out.println(x + "");
    }
    public static String join(List<?> x, String space) {
        StringBuilder sb = new StringBuilder();
        for (Object elt : x) {
            sb.append(elt);
            sb.append(space);
        }
        return sb.toString();
    }

    public static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine().trim());
        }
        return st.nextToken();
    }
    public static double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public static List<Double> nextDoubles(int n) throws IOException{
        List<Double> lst = new ArrayList<Double>();
        for (int i = 0; i < n; i++) {
            lst.add(nextDouble());
        }
        return lst;
    }
    public static List<Integer> nextInts(int n) throws IOException{
        List<Integer> lst = new ArrayList<Integer>();
        for (int i = 0; i < n; i++) {
            lst.add(nextInt());
        }
        return lst;
    }
    public static List<Long> nextLongs(int n) throws IOException{
        List<Long> lst = new ArrayList<Long>();
        for (int i = 0; i < n; i++) {
            lst.add(nextLong());
        }
        return lst;
    }
    public static List<Integer> emptyList(int n, int val) {
        List<Integer> lst = new ArrayList<Integer>();
        for (int i = 0; i < n; i++) {
            lst.add(val);
        }
        return lst;
    }

    public static void main(String[] args) throws Exception {
        boolean debug = false;
        InputStream in = System.in;
        if (debug) {
            in = new FileInputStream("input.in");
        }
        br = new BufferedReader(new InputStreamReader(in));

        int n = nextInt();
        int a = nextInt();
        int b = nextInt();
        List<Integer> nums = nextInts(n);
        print(solve(n, a, b, nums));
    }

    public static String solve(int n, int a, int b, List<Integer> nums) {
        Map<Integer, Integer> idx = new HashMap<Integer,Integer>();
        for (int i = 0; i < n; i++) {
            idx.put(nums.get(i), i);
        }
        Set<Integer> processed = new HashSet<Integer>();
        Deque<Integer> onedegree = new ArrayDeque<Integer>();
        Set<Integer> twodegree = new HashSet<Integer>();
        int[] ans = new int[n];

        for (int num: nums) {
            if (!idx.containsKey(a-num) && !idx.containsKey(b-num)) {
                return "NO";
            } else if (idx.containsKey(a-num) && idx.containsKey(b-num)) {
                twodegree.add(num);
            } else {
                onedegree.addLast(num);
            }
        }
        while (!onedegree.isEmpty()) {
            int cur = onedegree.removeFirst();
            if (processed.contains(cur)) continue;
            if (twodegree.contains(a - cur)) {
                twodegree.remove(a-cur);
                processed.add(cur);
                processed.add(a-cur);
                onedegree.addLast(b - (a - cur));
            } else if (twodegree.contains(b - cur)) {
                twodegree.remove(b-cur);
                processed.add(cur);
                processed.add(b-cur);
                ans[idx.get(cur)] = 1;
                ans[idx.get(b - cur)] = 1;
                onedegree.addLast(a - (b - cur));
            } else {
                if (idx.containsKey(a-cur) && !processed.contains(a-cur)) {
                    processed.add(cur);
                    processed.add(a-cur);
                } else if(idx.containsKey(b-cur) && !processed.contains(b-cur)){
                    processed.add(cur);
                    processed.add(b-cur);
                    ans[idx.get(cur)] = 1;
                    ans[idx.get(b - cur)] = 1;
                } else {
                    return "NO";
                }
            }
        }
        StringBuilder st = new StringBuilder();
        st.append("YES\n");
        for (int i = 0; i < n; i++) {
            st.append(ans[i] + " ");
        }
        st.deleteCharAt(st.length()-1);
        return st.toString();
    }
}
