import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.HashMap;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            num[] nums = new num[n];
            HashMap<Integer, Integer> ids = new HashMap<>();
            for (int i = 0; i < n; i++) {
                nums[i] = new num();
                nums[i].value = in.nextInt();
                ids.put(nums[i].value, i);
            }
            for (int i = 0; i < n; i++) {
                if (ids.containsKey(a - nums[i].value)) {
                    nums[i].a = nums[ids.get(a - nums[i].value)];
                }
                if (ids.containsKey(b - nums[i].value)) {
                    nums[i].b = nums[ids.get(b - nums[i].value)];
                }
            }
            for (int i = 0; i < n; i++) {
                if (nums[i].a == null && nums[i].b == null) {
                    out.println("NO");
                    return;
                } else if (nums[i].a == null) {
                    nums[i].b.a = null;
                } else if (nums[i].b == null) {
                    nums[i].a.b = null;
                }
            }
            boolean[] ans = new boolean[n];
            for (int i = 0; i < n; i++) {
                if (nums[i].a == null && nums[i].b == null) {
                    out.println("NO");
                    return;
                } else if (nums[i].a == null) {
                    ans[i] = true;
                }
            }
            out.println("YES");
            for (int i = 0; i < n; i++) {
                out.print(ans[i] ? 1 : 0);
                out.print(' ');
            }
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public String next() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    static class num {
        num a;
        num b;
        int value;

    }
}


/*package whatever //do not write package name here */

import java.io.*;
import java.util.Scanner;
import java.util.*;

public class  twosets
{
	public static void main (String[] args) {
		Scanner inp=new Scanner(System.in);
		int n=inp.nextInt();
		int a=inp.nextInt();
		int b=inp.nextInt();
		int [] ar= new int[n];
		HashMap<Integer,Integer> mp= new HashMap<Integer,Integer>();
		for(int i=0;i<n;i++)
		{
		    ar[i]=inp.nextInt();
		    mp.put(ar[i],1);
		}
		ArrayList<Integer> arr = new ArrayList<Integer>();
		for(int i=0;i<n;i++)
		{
		    if(mp.get(a-ar[i])==null)
		    {
		        arr.add(ar[i]);
		    }
		}
		for(int i=0;i<arr.size();i++)
		{
		    int now=arr.get(i);
		    mp.put(now,2);
		    if(mp.get(b-now)==null)
		    {
		        System.out.println("NO");
		        return ;
		    }
		    if(mp.get(b-now)==2)
		        continue;
		    mp.put(b-now,2);
		    if((mp.get(a-(b-now))!=null) && (mp.get(a-(b-now))!=null) )
		    {
		        mp.put(a-(b-now),2);
		        arr.add(a-(b-now));
		    }

		}
		System.out.println("YES");
		for(int i=0;i<n;i++)
		    System.out.print(mp.get(ar[i])-1+" ");

	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.TreeMap;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        Scanner scanner = new Scanner(System.in);
        solver.solve(1, scanner, out);
        out.close();
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer stt;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    public String next() {
        while (stt == null || !stt.hasMoreTokens()) {
            stt = new StringTokenizer(nextLine());
        }
        return stt.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}

class dsu {
    int[] parents;

    dsu(int n) {
        parents = new int[n];
        for (int i = 0; i < n; i++) {
            parents[i] = i;
        }
    }

    int find(int n) {
        if(parents[n] == n)
            return n;

        return find(parents[n]);
    }

    void union(int a, int b) {
        a = find(a);
        b = find(b);
        if (a != b)
            parents[a] = b;
    }

}

class Task {
    public void solve(int testNumber, Scanner in, PrintWriter out) {
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] p = new int[n];
        TreeMap<Integer, Integer> nums = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            p[i] = in.nextInt();
            nums.put(p[i], i);
        }
        dsu s = new dsu(n + 2);
        for (int i = 0; i < n; i++) {
            if (nums.containsKey(a - p[i])) {
                s.union(i, nums.get(a - p[i]));
            } else {
                s.union(i, n);
            }
            if (nums.containsKey(b - p[i])) {
                s.union(i, nums.get(b - p[i]));
            } else {
                s.union(i, n + 1);
            }
        }
        if (s.find(n) == s.find(n + 1)) {
            out.println("NO");
        } else {
            out.println("YES");
            for (int i = 0; i < n; i++) {
                out.print(s.find(i) == s.find(n) ? 1 : 0);
                out.print(' ');
            }
        }
    }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            int[] p = new int[n];
            TreeMap<Integer, Integer> nums = new TreeMap<>();
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
                nums.put(p[i], i);
            }
            dsu s = new dsu(n + 2);
            for (int i = 0; i < n; i++) {
                if (nums.containsKey(a - p[i])) {
                    s.union(i, nums.get(a - p[i]));
                } else {
                    s.union(i, n);
                }
                if (nums.containsKey(b - p[i])) {
                    s.union(i, nums.get(b - p[i]));
                } else {
                    s.union(i, n + 1);
                }
            }
            if (s.find(n) == s.find(n + 1)) {
                out.println("NO");
            } else {
                out.println("YES");
                for (int i = 0; i < n; i++) {
                    out.print(s.find(i) == s.find(n) ? 1 : 0);
                    out.print(' ');
                }
            }
        }

    }

    static class dsu {
        int[] parents;

        dsu(int n) {
            parents = new int[n];
            for (int i = 0; i < n; i++) {
                parents[i] = i;
            }
        }

        int find(int n) {
            if (parents[n] == n)
                return n;
            else
                return find(parents[n]);
        }

        void union(int a, int b) {
            a = find(a);
            b = find(b);
            if (a != b) {
                parents[a] = b;
            }
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public String next() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.util.TreeMap;
import java.util.Arrays;
import java.util.Scanner;

public class Subs {
    static Scanner in = new Scanner(System.in);
    public static void main(String[] args) {
        solve();
    }
    public static void solve() {
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] p = new int[n];
        TreeMap<Integer, Integer> nums = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            p[i] = in.nextInt();
            nums.put(p[i], i);
        }
        Dsu s = new Dsu(n + 2);
        for (int i = 0; i < n; i++) {
            if (nums.containsKey(a - p[i])) {
                s.union(i, nums.get(a - p[i]));
            } else {
                s.union(i, n);
            }
            if (nums.containsKey(b - p[i])) {
                s.union(i, nums.get(b - p[i]));
            } else {
                s.union(i, n + 1);
            }
        }
        if (s.find(n) == s.find(n + 1)) {
            System.out.println("NO");
        } else {
            System.out.println("YES");
            for (int i = 0; i < n; i++) {
                System.out.print((s.find(i) == s.find(n + 1) ? 0 : 1) + " ");
            }
        }
    }

}
class Dsu {
    int[] parents;

    Dsu(int n) {
        parents = new int[n];
        for (int i = 0; i < n; i++) {
            parents[i] = i;
        }
    }

    int find(int n) {
        if (parents[n] == n)
            return n;
        else
            return parents[n] = find(parents[n]);
    }

    void union(int a, int b) {
        a = find(a);
        b = find(b);
        if (a != b) {
            parents[a] = b;
        }
    }

    public String toString() {
        return Arrays.toString(parents);
    }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

class InputReader {
    private BufferedReader reader;
    private StringTokenizer stt;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    public String next() {
        while (stt == null || !stt.hasMoreTokens()) {
            stt = new StringTokenizer(nextLine());
        }
        return stt.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}

class dsu {
    int[] parents;

    dsu(int n) {
        parents = new int[n];
        for (int i = 0; i < n; i++) {
            parents[i] = i;
        }
    }

    int find(int n) {
        if(parents[n] == n)
            return n;

        return find(parents[n]);
    }

    void union(int a, int b) {
        a = find(a);
        b = find(b);
        if (a != b)
            parents[a] = b;
    }

}

class Task {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] p = new int[n];
        TreeMap<Integer, Integer> nums = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            p[i] = in.nextInt();
            nums.put(p[i], i);
        }
        dsu s = new dsu(n + 2);
        for (int i = 0; i < n; i++) {
            if (nums.containsKey(a - p[i])) {
                s.union(i, nums.get(a - p[i]));
            } else {
                s.union(i, n);
            }
            if (nums.containsKey(b - p[i])) {
                s.union(i, nums.get(b - p[i]));
            } else {
                s.union(i, n + 1);
            }
        }
        if (s.find(n) == s.find(n + 1)) {
            out.println("NO");
        } else {
            out.println("YES");
            for (int i = 0; i < n; i++) {
                out.print(s.find(i) == s.find(n) ? 1 : 0);
                out.print(' ');
            }
        }
    }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            int[] p = new int[n];
            TreeMap<Integer, Integer> nums = new TreeMap<>();
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
                nums.put(p[i], i);
            }
            dsu s = new dsu(n + 2);
            for (int i = 0; i < n; i++) {
                if (nums.containsKey(a - p[i])) {
                    s.union(i, nums.get(a - p[i]));
                } else {
                    s.union(i, n);
                }
                if (nums.containsKey(b - p[i])) {
                    s.union(i, nums.get(b - p[i]));
                } else {
                    s.union(i, n + 1);
                }
            }
            if (s.find(n) == s.find(n + 1)) {
                out.println("NO");
            } else {
                out.println("YES");
                for (int i = 0; i < n; i++) {
                    out.print(s.find(i) == s.find(n) ? 1 : 0);
                    out.print(' ');
                }
            }
        }

    }

    static class dsu {
        int[] parents;

        dsu(int n) {
            parents = new int[n];
            for (int i = 0; i < n; i++) {
                parents[i] = i;
            }
        }

        int find(int n) {
            if (parents[n] == n)
                return n;
            else
                return parents[n] = find(parents[n]);
        }

        void union(int a, int b) {
            a = find(a);
            b = find(b);
            if (a != b) {
                parents[a] = b;
            }
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public String next() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solve(1, in, out);
        out.close();
    }
    public static void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] p = new int[n];
        TreeMap<Integer, Integer> nums = new TreeMap<>();
        for (int i = 0; i < n; i++) {
            p[i] = in.nextInt();
            nums.put(p[i], i);
        }
        dsu s = new dsu(n + 2);
        for (int i = 0; i < n; i++) {
            if (nums.containsKey(a - p[i])) {
                s.union(i, nums.get(a - p[i]));
            } else {
                s.union(i, n);
            }
            if (nums.containsKey(b - p[i])) {
                s.union(i, nums.get(b - p[i]));
            } else {
                s.union(i, n + 1);
            }
        }
        if (s.find(n) == s.find(n + 1)) {
            out.println("NO");
        } else {
            out.println("YES");
            for (int i = 0; i < n; i++) {
                out.print(s.find(i) == s.find(n) ? 1 : 0);
                out.print(' ');
            }
        }
    }

}
class dsu {
    int[] parents;

    dsu(int n) {
        parents = new int[n];
        for (int i = 0; i < n; i++) {
            parents[i] = i;
        }
    }

    int find(int n) {
        if (parents[n] == n)
            return n;
        else
            return parents[n] = find(parents[n]);
    }

    void union(int a, int b) {
        a = find(a);
        b = find(b);
        if (a != b) {
            parents[a] = b;
        }
    }

}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer stt;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    public String next() {
        while (stt == null || !stt.hasMoreTokens()) {
            stt = new StringTokenizer(nextLine());
        }
        return stt.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}


import java.util.*;

public class Subs {
    static Scanner scanner;
    static int[] vis;
    static int[] way;
    static int[] A;
    static int[] B;
    static int[] p;
    static int n;
    static int a;
    static int b;

    static Map<Integer, Integer> hs;

    public static int dfs(int u,int p,int s) {
        vis[u]=1;
        way[u]=s;
        if (p == 0) {
            if (A[u] == u) return 1;
            if (A[u] == -1) return s;
            return dfs(A[u], p^1, s);
        } else {
            if (B[u] == u) return 1;
            if (B[u] == -1) return s^1;
            return dfs(B[u], p^1, s);
        }
    }

    public static int check0() {
        for (int i = 0; i < n; i++) {
            if (hs.get(a-p[i]) == null)
                return 0;
        }
        return 1;
    }
    public static int check1() {
        for (int i = 0; i < n; i++) {
            if (vis[i] == 0) {
                if (A[i] == i || B[i] == i)
                    continue;
                if (((A[i]==-1 ? 1:0)^(B[i]==-1 ? 1:0))==0)
                    continue;
                if (dfs(i,A[i]==-1 ? 1:0 ,A[i]==-1 ? 1:0) == 0 ) {
                    return 0;
                }
            }
        }
        for (int i = 0; i < n; i++) {
            if (vis[i] == 0) {
                if (A[i]==i) {
                    vis[i]=1;
                    way[i]=0;
                }
                else if (B[i]==i) {
                    vis[i]=1;
                    way[i]=1;
                }
            }
        }
        for (int i = 0; i < n; i++) {
            if (vis[i] == 0)
                return 0;
        }
        return 1;
    }
    public static void main(String[] args) {
        init();
        if(a == b) {
            if(check0() == 1) {
                System.out.println("YES");
                for (int i = 0; i < n; i++) {
                    System.out.print("0");
                    if (i != n-1)
                        System.out.print(" ");
                }
            } else {
                System.out.println("NO");
            }
        } else {
            for (int i = 0; i < n; i++) {
                if (hs.get(a-p[i]) != null)
                    A[i] = hs.get(a-p[i]);
                else
                    A[i] = -1;
                if (hs.get(b-p[i]) != null)
                    B[i] = hs.get(b-p[i]);
                else
                    B[i] = -1;
            }
            if (check1() == 1) {
                System.out.println("YES");
                for (int i = 0; i < n; i++) {
                    System.out.print((way[i] - 48)+'0');
                    if (i!=n-1)
                        System.out.print(" ");
                }
            } else
                System.out.println("NO");
        }
    }

    private static void init() {
        hs = new HashMap<>();
        scanner = new Scanner(System.in);
        n = scanner.nextInt();
        a = scanner.nextInt();
        b = scanner.nextInt();
        vis = new int[n];
        way = new int[n];
        A = new int[n];
        B = new int[n];
        p = new int[n];
        for(int i = 0; i < n; i++) {
            p[i] = scanner.nextInt();
            hs.put(p[i], i);
        }
    }
}


import java.util.TreeMap;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Subs {
    static Scanner in = new Scanner(System.in);
    public static void main(String[] args) {
        solve();
    }
    public static void solve() {
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] p = new int[n];
        Map<Integer, Integer> nums = new HashMap<>();
        for (int i = 0; i < n; i++) {
            p[i] = in.nextInt();
            nums.put(p[i], i);
        }
        Dsu s = new Dsu(n + 2);
        for (int i = 0; i < n; i++) {
            if (nums.containsKey(a - p[i])) {
                s.union(i, nums.get(a - p[i]));
            } else {
                s.union(i, n);
            }
            if (nums.containsKey(b - p[i])) {
                s.union(i, nums.get(b - p[i]));
            } else {
                s.union(i, n + 1);
            }
        }
        if (s.find(n) == s.find(n + 1)) {
            System.out.println("NO");
        } else {
            System.out.println("YES");
            for (int i = 0; i < n; i++) {
                System.out.print((s.find(i) == s.find(n + 1) ? 0 : 1) + " ");
            }
        }
    }

}
class Dsu {
    int[] parents;

    Dsu(int n) {
        parents = new int[n];
        for (int i = 0; i < n; i++) {
            parents[i] = i;
        }
    }

    int find(int n) {
        if (parents[n] != n)
            parents[n] = find(parents[n]);
        return parents[n];
    }

    void union(int a, int b) {
        a = find(a);
        b = find(b);
        if (a != b) {
            parents[a] = b;
        }
    }

    public String toString() {
        return Arrays.toString(parents);
    }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.Collection;
import java.util.AbstractSet;
import java.util.Set;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.TreeSet;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Queue;
import java.util.Comparator;
import java.util.ArrayDeque;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        BDvaMnozhestva solver = new BDvaMnozhestva();
        solver.solve(1, in, out);
        out.close();
    }

    static class BDvaMnozhestva {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int a = in.readInt();
            int b = in.readInt();
            int[] arr = in.readIntArray(n);
            Map<Integer, Integer> idx = new HashMap<>();
            for (int i = 0; i < n; i++) idx.put(arr[i], i);
            List<Integer>[] g1 = new List[n];
            List<Integer>[] g2 = new List[n];
            for (int i = 0; i < n; i++) {
                g1[i] = new ArrayList<>();
                g2[i] = new ArrayList<>();
                int x = arr[i];
                if (idx.containsKey(a - x)) g1[i].add(idx.get(a - x));
                if (idx.containsKey(b - x)) g2[i].add(idx.get(b - x));
                if (g1[i].size() + g2[i].size() == 0) {
                    out.print("NO");
                    return;
                }
            }
            TreeSet<Integer> q = new TreeSet<>(Comparator.comparingInt((Integer v) -> g1[v].size() + g2[v].size()).thenComparingInt((Integer v) -> v));
            for (int i = 0; i < n; i++) q.add(i);
            int[] type = new int[n];
            Arrays.fill(type, -1);
            while (!q.isEmpty()) {
                int v = q.pollFirst();
                if (type[v] != -1) continue;
                if (g1[v].isEmpty() && g2[v].isEmpty()) {
                    out.print("NO");
                    return;
                }
                int t = g1[v].isEmpty() ? 1 : 0;
                type[v] = t;
                List<Integer>[] g = t == 0 ? g1 : g2;
                List<Integer> q2 = new ArrayList<>();
                q2.add(v);
                for (int i = 0; i < q2.size(); i++) {
                    int x = q2.get(i);
                    for (int to : g[x]) {
                        if (type[to] == -1) {
                            type[to] = t;
                            q2.add(to);
                        } else if (type[to] != t) {
                            out.print("NO");
                            return;
                        }
                    }
                }
                Set<Integer> starts = new HashSet<>(q2);
                List<Integer>[] gr = g == g1 ? g2 : g1;
                bfs(starts, gr);
                q.removeAll(starts);
                for (int x : starts) gr[x].clear();
                q.addAll(starts);
            }
            out.printLine("YES");
            out.print(type);
        }

        void bfs(Set<Integer> starts, List<Integer>[] g) {
            Queue<Integer> q = new ArrayDeque<>(starts);
            while (!q.isEmpty()) {
                int v = q.poll();
                for (int to : g[v]) if (starts.add(to)) q.add(to);
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static 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 print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(array[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

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

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Iterator;
import java.io.BufferedWriter;
import java.util.Set;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.HashSet;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        BDvaMnozhestva solver = new BDvaMnozhestva();
        solver.solve(1, in, out);
        out.close();
    }

    static class BDvaMnozhestva {
        int a;
        int b;
        Set<Integer> all;
        Set<Integer>[] groups;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            a = in.readInt();
            b = in.readInt();
            int[] arr = in.readIntArray(n);
            all = new HashSet<>();
            groups = new Set[3];
            for (int i = 0; i < 3; i++) groups[i] = new HashSet<>();
            for (int i = 0; i < n; i++) all.add(arr[i]);
            for (int x : all) update(x);
            if (a == b) {
                if (groups[2].size() == n) {
                    out.printLine("YES");
                    out.print(new int[n]);
                } else {
                    out.print("NO");
                }
                return;
            }
            if (!groups[0].isEmpty()) {
                out.print("NO");
                return;
            }
            Set<Integer> ansA = new HashSet<>();
            while (!groups[1].isEmpty()) {
                int x = groups[1].iterator().next();
                all.remove(x);
                update(x);
                if (all.contains(a - x)) {
                    ansA.add(x);
                    ansA.add(a - x);
                    all.remove(a - x);
                    update(a - x);
                } else if (all.contains(b - x)) {
                    all.remove(b - x);
                    update(b - x);
                } else {
                    break;
                }
                update(a - x);
                update(b - x);
            }
            if (!all.isEmpty()) {
                out.print("NO");
                return;
            }
            out.printLine("YES");
            for (int i = 0; i < n; i++) out.print((ansA.contains(arr[i]) ? 0 : 1) + " ");
        }

        int update(int x) {
            for (int i = 0; i < groups.length; i++) groups[i].remove(x);
            if (!all.contains(x)) return -1;
            int count = 0;
            if (all.contains(a - x)) count++;
            if (all.contains(b - x)) count++;
            groups[count].add(x);
            return count;
        }

    }

    static 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 print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(array[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

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

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.io.BufferedWriter;
import java.util.Collection;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Queue;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        BDvaMnozhestva solver = new BDvaMnozhestva();
        solver.solve(1, in, out);
        out.close();
    }

    static class BDvaMnozhestva {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int a = in.readInt();
            int b = in.readInt();
            int[] arr = in.readIntArray(n);
            Map<Integer, Integer> idx = new HashMap<>();
            for (int i = 0; i < n; i++) idx.put(arr[i], i);
            List<Integer>[] g1 = new List[n];
            List<Integer>[] g2 = new List[n];
            for (int i = 0; i < n; i++) {
                g1[i] = new ArrayList<>();
                g2[i] = new ArrayList<>();
                int x = arr[i];
                if (idx.containsKey(a - x)) g1[i].add(idx.get(a - x));
                if (idx.containsKey(b - x)) g2[i].add(idx.get(b - x));
                if (g1[i].size() + g2[i].size() == 0) {
                    out.print("NO");
                    return;
                }
            }
            Queue<Integer> q = new PriorityQueue<>(Comparator.comparingInt(v -> g1[v].size() + g2[v].size()));
            for (int i = 0; i < n; i++) q.add(i);
            int[] type = new int[n];
            Arrays.fill(type, -1);
            while (!q.isEmpty()) {
                int v = q.poll();
                if (type[v] != -1) continue;
                if (g1[v].isEmpty() == g2[v].isEmpty()) continue;
                int t = g1[v].isEmpty() ? 1 : 0;
                type[v] = t;
                List<Integer>[] g = t == 0 ? g1 : g2;
                List<Integer> q2 = new ArrayList<>();
                q2.add(v);
                for (int i = 0; i < q2.size(); i++) {
                    int x = q2.get(i);
                    for (int to : g[x]) {
                        if (type[to] == -1) {
                            type[to] = t;
                            q2.add(to);
                        } else if (type[to] != t) {
                            out.print("NO");
                            return;
                        }
                    }
                }
            }
            out.print(type);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static 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 print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(array[i]);
            }
        }

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

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.io.BufferedWriter;
import java.util.Collection;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Queue;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        BDvaMnozhestva solver = new BDvaMnozhestva();
        solver.solve(1, in, out);
        out.close();
    }

    static class BDvaMnozhestva {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int a = in.readInt();
            int b = in.readInt();
            int[] arr = in.readIntArray(n);
            Map<Integer, Integer> idx = new HashMap<>();
            for (int i = 0; i < n; i++) idx.put(arr[i], i);
            List<Integer>[] g1 = new List[n];
            List<Integer>[] g2 = new List[n];
            for (int i = 0; i < n; i++) {
                g1[i] = new ArrayList<>();
                g2[i] = new ArrayList<>();
                int x = arr[i];
                if (idx.containsKey(a - x)) g1[i].add(idx.get(a - x));
                if (idx.containsKey(b - x)) g2[i].add(idx.get(b - x));
                if (g1[i].size() + g2[i].size() == 0) {
                    out.print("NO");
                    return;
                }
            }
            Queue<Integer> q = new PriorityQueue<>(Comparator.comparingInt(v -> g1[v].size() + g2[v].size()));
            for (int i = 0; i < n; i++) q.add(i);
            int[] type = new int[n];
            Arrays.fill(type, -1);
            while (!q.isEmpty()) {
                int v = q.poll();
                if (type[v] != -1) continue;
                int t = g1[v].isEmpty() ? 1 : 0;
                type[v] = t;
                List<Integer>[] g = t == 0 ? g1 : g2;
                List<Integer> q2 = new ArrayList<>();
                q2.add(v);
                for (int i = 0; i < q2.size(); i++) {
                    int x = q2.get(i);
                    for (int to : g[x]) {
                        if (type[to] == -1) {
                            type[to] = t;
                            q2.add(to);
                        } else if (type[to] != t) {
                            out.print("NO");
                            return;
                        }
                    }
                }
            }
            out.printLine("YES");
            out.print(type);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static 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 print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(array[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

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

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.io.BufferedWriter;
import java.util.Collection;
import java.util.Set;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Queue;
import java.util.Comparator;
import java.util.ArrayDeque;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        BDvaMnozhestva solver = new BDvaMnozhestva();
        solver.solve(1, in, out);
        out.close();
    }

    static class BDvaMnozhestva {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int a = in.readInt();
            int b = in.readInt();
            int[] arr = in.readIntArray(n);
            Map<Integer, Integer> idx = new HashMap<>();
            for (int i = 0; i < n; i++) idx.put(arr[i], i);
            List<Integer>[] g1 = new List[n];
            List<Integer>[] g2 = new List[n];
            for (int i = 0; i < n; i++) {
                g1[i] = new ArrayList<>();
                g2[i] = new ArrayList<>();
                int x = arr[i];
                if (idx.containsKey(a - x)) g1[i].add(idx.get(a - x));
                if (idx.containsKey(b - x)) g2[i].add(idx.get(b - x));
                if (g1[i].size() + g2[i].size() == 0) {
                    out.print("NO");
                    return;
                }
            }
            Queue<Integer> q = new PriorityQueue<>(Comparator.comparingInt(v -> g1[v].size() + g2[v].size()));
            for (int i = 0; i < n; i++) q.add(i);
            int[] type = new int[n];
            Arrays.fill(type, -1);
            while (!q.isEmpty()) {
                int v = q.poll();
                if (type[v] != -1) continue;
                if (g1[v].isEmpty() && g2[v].isEmpty()) {
                    out.print("NO");
                    return;
                }
                int t = g1[v].isEmpty() ? 1 : 0;
                type[v] = t;
                List<Integer>[] g = t == 0 ? g1 : g2;
                List<Integer> q2 = new ArrayList<>();
                q2.add(v);
                for (int i = 0; i < q2.size(); i++) {
                    int x = q2.get(i);
                    for (int to : g[x]) {
                        if (type[to] == -1) {
                            type[to] = t;
                            q2.add(to);
                        } else if (type[to] != t) {
                            out.print("NO");
                            return;
                        }
                    }
                }
                Set<Integer> starts = new HashSet<>(q2);
                bfs(starts, g == g1 ? g2 : g1);
                q.addAll(starts);
            }
            out.printLine("YES");
            out.print(type);
        }

        void bfs(Set<Integer> starts, List<Integer>[] g) {
            Queue<Integer> q = new ArrayDeque<>(starts);
            while (!q.isEmpty()) {
                int v = q.poll();
                for (int to : g[v]) if (starts.add(to)) q.add(to);
            }
            for (int x : starts) g[x].clear();
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static 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 print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(array[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

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

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Iterator;
import java.io.BufferedWriter;
import java.util.Set;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.HashSet;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        BDvaMnozhestva solver = new BDvaMnozhestva();
        solver.solve(1, in, out);
        out.close();
    }

    static class BDvaMnozhestva {
        int a;
        int b;
        Set<Integer> all;
        Set<Integer>[] groups;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            a = in.readInt();
            b = in.readInt();
            int[] arr = in.readIntArray(n);
            all = new HashSet<>();
            groups = new Set[3];
            for (int i = 0; i < 3; i++) groups[i] = new HashSet<>();
            for (int i = 0; i < n; i++) all.add(arr[i]);
            for (int x : all) update(x);
            if (a == b) {
                if (groups[2].size() == n) {
                    out.printLine("YES");
                    out.print(new int[n]);
                } else {
                    out.print("NO");
                }
                return;
            }
            if (!groups[0].isEmpty()) {
                out.print("NO");
                return;
            }
            Set<Integer> ansA = new HashSet<>();
            while (!groups[1].isEmpty()) {
                int x = groups[1].iterator().next();
                all.remove(x);
                update(x);
                if (all.contains(a - x)) {
                    ansA.add(x);
                    ansA.add(a - x);
                    all.remove(a - x);
                    update(a - x);
                    update(b - (a - x));
                } else if (all.contains(b - x)) {
                    all.remove(b - x);
                    update(b - x);
                    update(a - (b - x));
                } else {
                    break;
                }
            }
            if (!all.isEmpty()) {
                out.print("NO");
                return;
            }
            out.printLine("YES");
            for (int i = 0; i < n; i++) out.print((ansA.contains(arr[i]) ? 0 : 1) + " ");
        }

        int update(int x) {
            for (int i = 0; i < groups.length; i++) groups[i].remove(x);
            if (!all.contains(x)) return -1;
            int count = 0;
            if (all.contains(a - x)) count++;
            if (all.contains(b - x)) count++;
            groups[count].add(x);
            return count;
        }

    }

    static 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 print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(array[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

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

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.io.BufferedWriter;
import java.util.Collection;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Queue;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        BDvaMnozhestva solver = new BDvaMnozhestva();
        solver.solve(1, in, out);
        out.close();
    }

    static class BDvaMnozhestva {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int a = in.readInt();
            int b = in.readInt();
            int[] arr = in.readIntArray(n);
            Map<Integer, Integer> idx = new HashMap<>();
            for (int i = 0; i < n; i++) idx.put(arr[i], i);
            List<Integer>[] g1 = new List[n];
            List<Integer>[] g2 = new List[n];
            for (int i = 0; i < n; i++) {
                g1[i] = new ArrayList<>();
                g2[i] = new ArrayList<>();
                int x = arr[i];
                if (idx.containsKey(a - x)) g1[i].add(idx.get(a - x));
                if (idx.containsKey(b - x)) g2[i].add(idx.get(b - x));
                if (g1[i].size() + g2[i].size() == 0) {
                    out.print("NO");
                    return;
                }
            }
            Queue<Integer> q = new PriorityQueue<>(Comparator.comparingInt(v -> g1[v].size() + g2[v].size()));
            for (int i = 0; i < n; i++) q.add(i);
            int[] type = new int[n];
            Arrays.fill(type, -1);
            while (!q.isEmpty()) {
                int v = q.poll();
                if (type[v] != -1) continue;
                if (g1[v].isEmpty() == g2[v].isEmpty()) continue;
                int t = g1[v].isEmpty() ? 1 : 0;
                type[v] = t;
                List<Integer>[] g = t == 0 ? g1 : g2;
                List<Integer> q2 = new ArrayList<>();
                q2.add(v);
                for (int i = 0; i < q2.size(); i++) {
                    int x = q2.get(i);
                    for (int to : g[x]) {
                        if (type[to] == -1) {
                            type[to] = t;
                            q2.add(to);
                        } else if (type[to] != t) {
                            out.print("NO");
                            return;
                        }
                    }
                }
            }
            out.printLine("YES");
            out.print(type);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static 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 print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(array[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

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

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.io.BufferedWriter;
import java.util.Collection;
import java.util.Set;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Queue;
import java.util.Comparator;
import java.util.ArrayDeque;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (t.me/musin_acm)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        BDvaMnozhestva solver = new BDvaMnozhestva();
        solver.solve(1, in, out);
        out.close();
    }

    static class BDvaMnozhestva {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int a = in.readInt();
            int b = in.readInt();
            int[] arr = in.readIntArray(n);
            Map<Integer, Integer> idx = new HashMap<>();
            for (int i = 0; i < n; i++) idx.put(arr[i], i);
            List<Integer>[] g1 = new List[n];
            List<Integer>[] g2 = new List[n];
            for (int i = 0; i < n; i++) {
                g1[i] = new ArrayList<>();
                g2[i] = new ArrayList<>();
                int x = arr[i];
                if (idx.containsKey(a - x)) g1[i].add(idx.get(a - x));
                if (idx.containsKey(b - x)) g2[i].add(idx.get(b - x));
                if (g1[i].size() + g2[i].size() == 0) {
                    out.print("NO");
                    return;
                }
            }
            Queue<Integer> q = new PriorityQueue<>(Comparator.comparingInt(v -> g1[v].size() + g2[v].size()));
            for (int i = 0; i < n; i++) q.add(i);
            int[] type = new int[n];
            Arrays.fill(type, -1);
            while (!q.isEmpty()) {
                int v = q.poll();
                if (type[v] != -1) continue;
                int t = g1[v].isEmpty() ? 1 : 0;
                type[v] = t;
                List<Integer>[] g = t == 0 ? g1 : g2;
                List<Integer> q2 = new ArrayList<>();
                q2.add(v);
                for (int i = 0; i < q2.size(); i++) {
                    int x = q2.get(i);
                    for (int to : g[x]) {
                        if (type[to] == -1) {
                            type[to] = t;
                            q2.add(to);
                        } else if (type[to] != t) {
                            out.print("NO");
                            return;
                        }
                    }
                }
                Set<Integer> starts = new HashSet<>(q2);
                bfs(starts, g == g1 ? g2 : g1);
                q.addAll(starts);
            }
            out.printLine("YES");
            out.print(type);
        }

        void bfs(Set<Integer> starts, List<Integer>[] g) {
            Queue<Integer> q = new ArrayDeque<>(starts);
            while (!q.isEmpty()) {
                int v = q.poll();
                for (int to : g[v]) if (starts.add(to)) q.add(to);
            }
            for (int x : starts) g[x].clear();
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

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

        public int[] readIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = readInt();
            }
            return array;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            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 readInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static 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 print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(array[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

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

    }
}


#include <bits/stdc++.h>
using namespace std;
#define N 300009
#define INF 1000000000000009
#define MOD 1000000007
typedef long long ll;
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d ",x);
#define pf2(x,y) printf("%d %d\n",x,y);
#define p3(x,y,z) printf("%d %d %d\n",x,y,z);
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define tr(x) cout<<x<< endl;
#define tr2(x,y) cout<<x<<" "<<y<<" " << endl;
#define tr3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl;
#define tr4(x,y,z,a) cout<<x<<" "<<y<<" "<<z<<  " " << a << " " << endl;
#define sz(x) (int)x.size()

const int inf = 1e9;

int ans[N];
int arr[N],a,b;
//1 indexed Hopcroft-Karp Matching in O(E sqrtV)

struct Hopcroft_Karp
{
	static const int inf = 1e9;

	int n;
	vector<int> matchL, matchR, dist;
	vector<vector<int> > g;

	Hopcroft_Karp(int n) :
		n(n), matchL(n+1), matchR(n+1), dist(n+1), g(n+1) {}

	void addEdge(int u, int v)
	{
		g[u].push_back(v);
	}

	bool bfs()
	{
		queue<int> q;
		for(int u=1;u<=n;u++)
		{
			if(!matchL[u])
			{
				dist[u]=0;
				q.push(u);
			}
			else
				dist[u]=inf;
		}
		dist[0]=inf;

		while(!q.empty())
		{
			int u=q.front();
			q.pop();
			for(auto v:g[u])
			{
				if(dist[matchR[v]] == inf)
				{
					dist[matchR[v]] = dist[u] + 1;
					q.push(matchR[v]);
				}
			}
		}

		return (dist[0]!=inf);
	}

	bool dfs(int u)
	{
		if(!u)
			return true;
		for(auto v:g[u])
		{
			if(dist[matchR[v]] == dist[u]+1 &&dfs(matchR[v]))
			{
				matchL[u]=v;
				matchR[v]=u;

				return true;
			}
		}
		dist[u]=inf;
		return false;
	}

	int max_matching()
	{
		int matching=0;
		while(bfs())
		{
			for(int u=1;u<=n;u++)
			{
				if(!matchL[u])
					if(dfs(u))
						matching++;
			}
		}
		return matching;
	}
};
unordered_map<int, int> mymap;
int main(){
	int i,j,k,n,m,x,y,z;
	sd3(n, a, b);

	Hopcroft_Karp hkp(n);
	for(i=1; i<=n; i++){
	    sd(arr[i]);
        mymap[arr[i]] = i;
	}
    for(i=1; i<=n; i++){
        x = a- arr[i];
        y = b - arr[i];
        if(mymap.count(x)){
            hkp.addEdge(i, mymap[x]);

        }

        if(mymap.count(y)){
            hkp.addEdge(i, mymap[y]);

        }

    }
	ll an = hkp.max_matching();

    // tr(an);

    if(an != n){
        tr("NO");
        return 0;
    }
    tr("YES");
    for(i=1; i<=n; i++){
        x = hkp.matchL[i];

        if( arr[hkp.matchL[i]] + arr[hkp.matchR[x]] == a){ans[i] = 0;}
        else{ans[i] = 1;}
    }
	for(i=1; i<=n; i++){
        pf(ans[i]);
    }

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 300009
#define INF 1000000000000009
#define MOD 1000000007
typedef long long ll;
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d ",x);
#define pf2(x,y) printf("%d %d\n",x,y);
#define p3(x,y,z) printf("%d %d %d\n",x,y,z);
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define tr(x) cout<<x<< endl;
#define tr2(x,y) cout<<x<<" "<<y<<" " << endl;
#define tr3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl;
#define tr4(x,y,z,a) cout<<x<<" "<<y<<" "<<z<<  " " << a << " " << endl;
#define sz(x) (int)x.size()

// for unit capacities, running time is O(min(V^{2/3}, E^{1/2}) * E), otherwise running time is O(V^2 * E)
// This results in O(\sqrt(V) * E) for bipartite matching problem = Hopcroft Karp Algorithm

const int inf = 1e9;

struct edge {
    int x, y, cap, flow, tag;
};
int ans[N];
int arr[N],a,b;
//1 indexed Hopcroft-Karp Matching in O(E sqrtV)

struct Hopcroft_Karp
{
	static const int inf = 1e9;

	int n;
	vector<int> matchL, matchR, dist;
	vector<vector<int> > g;

	Hopcroft_Karp(int n) :
		n(n), matchL(n+1), matchR(n+1), dist(n+1), g(n+1) {}

	void addEdge(int u, int v)
	{
		g[u].push_back(v);
	}

	bool bfs()
	{
		queue<int> q;
		for(int u=1;u<=n;u++)
		{
			if(!matchL[u])
			{
				dist[u]=0;
				q.push(u);
			}
			else
				dist[u]=inf;
		}
		dist[0]=inf;

		while(!q.empty())
		{
			int u=q.front();
			q.pop();
			for(auto v:g[u])
			{
				if(dist[matchR[v]] == inf)
				{
					dist[matchR[v]] = dist[u] + 1;
					q.push(matchR[v]);
				}
			}
		}

		return (dist[0]!=inf);
	}

	bool dfs(int u)
	{
		if(!u)
			return true;
		for(auto v:g[u])
		{
			if(dist[matchR[v]] == dist[u]+1 &&dfs(matchR[v]))
			{
				matchL[u]=v;
				matchR[v]=u;

                if(b-arr[u]==arr[v-n/2]){
                    ans[u] = 1;
                    ans[v-n/2] = 1;
                }

				return true;
			}
		}
		dist[u]=inf;
		return false;
	}

	int max_matching()
	{
		int matching=0;
		while(bfs())
		{
			for(int u=1;u<=n;u++)
			{
				if(!matchL[u])
					if(dfs(u))
						matching++;
			}
		}
		return matching;
	}
};
unordered_map<int, vector<int>> mymap;
int main(){
	int i,j,k,n,m,x,y,z;
	sd3(n, a, b);

	Hopcroft_Karp hkp(2*n);
	for(i=1; i<=n; i++){
	    sd(arr[i]);
        mymap[arr[i]].pb(i);
	}
    for(i=1; i<=n; i++){
        x = arr[i];
        for(auto j:mymap[a-x]){
           hkp.addEdge(i, j+n);
           hkp.addEdge(j, i+n);
       }

       for(auto j:mymap[b-x]){
           hkp.addEdge(i, j+n);
           hkp.addEdge(j, i+n);
       }
    }
	ll an = hkp.max_matching();

    // tr(an);

    if(an != n){
        tr("NO");
        return 0;
    }
    tr("YES");
	for(i=1; i<=n; i++){
        pf(ans[i]);
    }

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 300009
#define INF 1000000000000009
#define MOD 1000000007
typedef long long ll;
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d ",x);
#define pf2(x,y) printf("%d %d\n",x,y);
#define p3(x,y,z) printf("%d %d %d\n",x,y,z);
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define tr(x) cout<<x<< endl;
#define tr2(x,y) cout<<x<<" "<<y<<" " << endl;
#define tr3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl;
#define tr4(x,y,z,a) cout<<x<<" "<<y<<" "<<z<<  " " << a << " " << endl;
#define sz(x) (int)x.size()

const int inf = 1e9;

int ans[N];
int arr[N],a,b;
//1 indexed Hopcroft-Karp Matching in O(E sqrtV)

struct Hopcroft_Karp
{
	static const int inf = 1e9;

	int n;
	vector<int> matchL, matchR, dist;
	vector<vector<int> > g;

	Hopcroft_Karp(int n) :
		n(n), matchL(n+1), matchR(n+1), dist(n+1), g(n+1) {}

	void addEdge(int u, int v)
	{
		g[u].push_back(v);
	}

	bool bfs()
	{
		queue<int> q;
		for(int u=1;u<=n;u++)
		{
			if(!matchL[u])
			{
				dist[u]=0;
				q.push(u);
			}
			else
				dist[u]=inf;
		}
		dist[0]=inf;

		while(!q.empty())
		{
			int u=q.front();
			q.pop();
			for(auto v:g[u])
			{
				if(dist[matchR[v]] == inf)
				{
					dist[matchR[v]] = dist[u] + 1;
					q.push(matchR[v]);
				}
			}
		}

		return (dist[0]!=inf);
	}

	bool dfs(int u)
	{
		if(!u)
			return true;
		for(auto v:g[u])
		{
			if(dist[matchR[v]] == dist[u]+1 &&dfs(matchR[v]))
			{
				matchL[u]=v;
				matchR[v]=u;

				return true;
			}
		}
		dist[u]=inf;
		return false;
	}

	int max_matching()
	{
		int matching=0;
		while(bfs())
		{
			for(int u=1;u<=n;u++)
			{
				if(!matchL[u])
					if(dfs(u))
						matching++;
			}
		}
		return matching;
	}
};
unordered_map<int, int> mymap;
int main(){
	int i,j,k,n,m,x,y,z;
	sd3(n, a, b);

	Hopcroft_Karp hkp(n);
	for(i=1; i<=n; i++){
	    sd(arr[i]);
        mymap[arr[i]] = i;
	}
    for(i=1; i<=n; i++){
        x = a- arr[i];
        y = b - arr[i];
        if(mymap.count(x)){
            hkp.addEdge(i, mymap[x]);

        }

        if(mymap.count(y)){
            hkp.addEdge(i, mymap[y]);

        }

    }
	ll an = hkp.max_matching();

    // tr(an);

    if(an != n){
        tr("NO");
        return 0;
    }
    tr("YES");
    for(i=1; i<=n; i++){
        x = hkp.matchL[i];

        if( arr[hkp.matchL[i]] + arr[hkp.matchR[x]] == a){ans[i] = 0;}
        else{ans[i] = 1;}
    }
	for(i=1; i<=n; i++){
        pf(ans[i]);
    }

	return 0;
}

// https://codeforces.com/problemset/problem/468/B


    #include <bits/stdc++.h>
    using namespace std;
    #define N 300009
    #define INF 1000000000000009
    #define MOD 1000000007
    typedef long long ll;
    #define sd(x) scanf("%d",&x)
    #define sd2(x,y) scanf("%d%d",&x,&y)
    #define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
    #define pf(x) printf("%d ",x);
    #define pf2(x,y) printf("%d %d\n",x,y);
    #define p3(x,y,z) printf("%d %d %d\n",x,y,z);
    #define fi first
    #define se second
    #define pb(x) push_back(x)
    #define mp(x,y) make_pair(x,y)
    #define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    #define tr(x) cout<<x<< endl;
    #define tr2(x,y) cout<<x<<" "<<y<<" " << endl;
    #define tr3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl;
    #define tr4(x,y,z,a) cout<<x<<" "<<y<<" "<<z<<  " " << a << " " << endl;
    #define sz(x) (int)x.size()

    const int inf = 1e9;

    int ans[N];
    int arr[N],a,b;
    //1 indexed Hopcroft-Karp Matching in O(E sqrtV)

    struct Hopcroft_Karp
    {
        static const int inf = 1e9;

        int n;
        vector<int> matchL, matchR, dist;
        vector<vector<int> > g;

        Hopcroft_Karp(int n) :
            n(n), matchL(n+1), matchR(n+1), dist(n+1), g(n+1) {}

        void addEdge(int u, int v)
        {
            g[u].push_back(v);
        }

        bool bfs()
        {
            queue<int> q;
            for(int u=1;u<=n;u++)
            {
                if(!matchL[u])
                {
                    dist[u]=0;
                    q.push(u);
                }
                else
                    dist[u]=inf;
            }
            dist[0]=inf;

            while(!q.empty())
            {
                int u=q.front();
                q.pop();
                for(auto v:g[u])
                {
                    if(dist[matchR[v]] == inf)
                    {
                        dist[matchR[v]] = dist[u] + 1;
                        q.push(matchR[v]);
                    }
                }
            }

            return (dist[0]!=inf);
        }

        bool dfs(int u)
        {
            if(!u)
                return true;
            for(auto v:g[u])
            {
                if(dist[matchR[v]] == dist[u]+1 &&dfs(matchR[v]))
                {
                    matchL[u]=v;
                    matchR[v]=u;

                    return true;
                }
            }
            dist[u]=inf;
            return false;
        }

        int max_matching()
        {
            int matching=0;
            while(bfs())
            {
                for(int u=1;u<=n;u++)
                {
                    if(!matchL[u])
                        if(dfs(u))
                            matching++;
                }
            }
            return matching;
        }
    };
    unordered_map<int, int> mymap;
    int main(){
        int i,j,k,n,m,x,y,z;
        sd3(n, a, b);

        Hopcroft_Karp hkp(n);
        for(i=1; i<=n; i++){
            sd(arr[i]);
            mymap[arr[i]] = i;
        }
        for(i=1; i<=n; i++){
            x = a- arr[i];
            y = b - arr[i];

            int xx = mymap[x], yy = mymap[y];
            if(!xx){
                hkp.addEdge(i, xx);
                hkp.addEdge(xx, i);
            }

            if(!yy){
                hkp.addEdge(i, yy);
                hkp.addEdge(yy, i);
            }

        }
        ll an = hkp.max_matching();

        // tr(an);

        if(an != n){
            tr("NO");
            return 0;
        }
        tr("YES");
        for(i=1; i<=n; i++){
            x = hkp.matchL[i];

            if( arr[hkp.matchL[i]] + arr[hkp.matchR[x]] == a){ans[i] = 0;}
            else{ans[i] = 1;}
        }
        for(i=1; i<=n; i++){
            pf(ans[i]);
        }

        return 0;
    }

// https://codeforces.com/problemset/problem/468/B


#include <bits/stdc++.h>
using namespace std;
#define N 300009
#define INF 1000000000000009
#define MOD 1000000007
typedef long long ll;
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d ",x);
#define pf2(x,y) printf("%d %d\n",x,y);
#define p3(x,y,z) printf("%d %d %d\n",x,y,z);
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define tr(x) cout<<x<< endl;
#define tr2(x,y) cout<<x<<" "<<y<<" " << endl;
#define tr3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl;
#define tr4(x,y,z,a) cout<<x<<" "<<y<<" "<<z<<  " " << a << " " << endl;
#define sz(x) (int)x.size()

const int inf = 1e9;

int ans[N];
int arr[N],a,b;
//1 indexed Hopcroft-Karp Matching in O(E sqrtV)

struct Hopcroft_Karp
{
	static const int inf = 1e9;

	int n;
	vector<int> matchL, matchR, dist;
	vector<vector<int> > g;

	Hopcroft_Karp(int n) :
		n(n), matchL(n+1), matchR(n+1), dist(n+1), g(n+1) {}

	void addEdge(int u, int v)
	{
		g[u].push_back(v);
	}

	bool bfs()
	{
		queue<int> q;
		for(int u=1;u<=n;u++)
		{
			if(!matchL[u])
			{
				dist[u]=0;
				q.push(u);
			}
			else
				dist[u]=inf;
		}
		dist[0]=inf;

		while(!q.empty())
		{
			int u=q.front();
			q.pop();
			for(auto v:g[u])
			{
				if(dist[matchR[v]] == inf)
				{
					dist[matchR[v]] = dist[u] + 1;
					q.push(matchR[v]);
				}
			}
		}

		return (dist[0]!=inf);
	}

	bool dfs(int u)
	{
		if(!u)
			return true;
		for(auto v:g[u])
		{
			if(dist[matchR[v]] == dist[u]+1 &&dfs(matchR[v]))
			{
				matchL[u]=v;
				matchR[v]=u;

				return true;
			}
		}
		dist[u]=inf;
		return false;
	}

	int max_matching()
	{
		int matching=0;
		while(bfs())
		{
			for(int u=1;u<=n;u++)
			{
				if(!matchL[u])
					if(dfs(u))
						matching++;
			}
		}
		return matching;
	}
};
unordered_map<int, int> mymap;
int main(){
	int i,j,k,n,m,x,y,z;
	sd3(n, a, b);

	Hopcroft_Karp hkp(n);
	for(i=1; i<=n; i++){
	    sd(arr[i]);
        mymap[arr[i]] = i;
	}
    for(i=1; i<=n; i++){
        x = a- arr[i];
        y = b - arr[i];
        if(mymap.count(x)){
            hkp.addEdge(i, mymap[x]);
            hkp.addEdge(mymap[x], i);
        }

        if(mymap.count(y)){
            hkp.addEdge(i, mymap[y]);
            hkp.addEdge(mymap[y], i);
        }

    }
	ll an = hkp.max_matching();

    // tr(an);

    if(an != n){
        tr("NO");
        return 0;
    }
    tr("YES");
    for(i=1; i<=n; i++){
        x = hkp.matchL[i];

        if( arr[hkp.matchL[i]] + arr[hkp.matchR[x]] == a){ans[i] = 0;}
        else{ans[i] = 1;}
    }
	for(i=1; i<=n; i++){
        pf(ans[i]);
    }

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 300009
#define INF 1000000000000009
#define MOD 1000000007
typedef long long ll;
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d ",x);
#define pf2(x,y) printf("%d %d\n",x,y);
#define p3(x,y,z) printf("%d %d %d\n",x,y,z);
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define tr(x) cout<<x<< endl;
#define tr2(x,y) cout<<x<<" "<<y<<" " << endl;
#define tr3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl;
#define tr4(x,y,z,a) cout<<x<<" "<<y<<" "<<z<<  " " << a << " " << endl;
#define sz(x) (int)x.size()

// for unit capacities, running time is O(min(V^{2/3}, E^{1/2}) * E), otherwise running time is O(V^2 * E)
// This results in O(\sqrt(V) * E) for bipartite matching problem = Hopcroft Karp Algorithm

const int inf = 1e9;

struct edge {
    int x, y, cap, flow, tag;
};

struct DinicFlow {
    vector <edge> e;
    vector <int> cur, d;
    vector < vector <int> > adj;
    int source, sink, n;

    DinicFlow() {}

    DinicFlow(int v, int s, int t) {
        n = v, source = s, sink = t;
        cur = vector <int> (n + 1);
        d = vector <int> (n + 1);
        adj = vector < vector <int> > (n + 1);
    }

    void addEdge(int from, int to, int cap, int tag) {
        edge e1 = {from, to, cap, 0, tag};
        edge e2 = {to, from, 0, 0, tag};
        adj[from].push_back(e.size()); e.push_back(e1);
        adj[to].push_back(e.size()); e.push_back(e2);
    }

    int bfs() {
        queue <int> q;
        for(int i = 0; i <= n; ++i) d[i] = -1;
        q.push(source); d[source] = 0;
        while(!q.empty() and d[sink] < 0) {
            int x = q.front(); q.pop();
            for(int i = 0; i < (int)adj[x].size(); ++i) {
                int id = adj[x][i], y = e[id].y;
                if(d[y] < 0 and e[id].flow < e[id].cap) {
                    q.push(y); d[y] = d[x] + 1;
                }
            }
        }
        return d[sink] >= 0;
    }

    int dfs(int x, int flow) {
        if(!flow) return 0;
        if(x == sink) return flow;
        for(;cur[x] < (int)adj[x].size(); ++cur[x]) {
            int id = adj[x][cur[x]], y = e[id].y;
            if(d[y] != d[x] + 1) continue;
            int pushed = dfs(y, min(flow, e[id].cap - e[id].flow));
            if(pushed) {
                e[id].flow += pushed;
                e[id ^ 1].flow -= pushed;
                return pushed;
            }
        }
        return 0;
    }

    ll maxFlow() {
        ll flow = 0;
        while(bfs()) {
            for(int i = 0; i <= n; ++i) cur[i] = 0;
            while(int pushed = dfs(source, inf)) {
                flow += 1ll*pushed;
            }
        }
        return flow;
    }
};
map<int, vector<int>> mymap;
int ans[N], arr[N];
int main(){
	int i,j,k,n,m,x,y,z,a,b;
	sd3(n, a, b);

	DinicFlow dinic(2*n+2, 0, 2*n+1);
	for(i=1; i<=n; i++){
	    sd(arr[i]);

       dinic.addEdge(0, i, 1, 0);
       dinic.addEdge(i+n, 2*n+1, 1, 0);

    mymap[arr[i]].pb(i);
	}
    for(i=1; i<=n; i++){
        x = arr[i];
        for(auto j:mymap[a-x]){
           dinic.addEdge(i, j+n, 1, 0);
       }

       for(auto j:mymap[b-x]){
           dinic.addEdge(i, j+n, 1, 1);
       }
    }
	ll an = dinic.maxFlow();

    // tr(an);

    if(an != n){
        tr("NO");
        return 0;
    }
    tr("YES");
    for(auto p:dinic.e){
        if(p.y>n && p.y<=2*n && p.flow>0){
            ans[p.x] = p.tag;
            ans[p.y-n] = p.tag;
        }

    }
	for(i=1; i<=n; i++){
        pf(ans[i]);
    }

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 300009
#define INF 1000000000000009
#define MOD 1000000007
typedef long long ll;
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d ",x);
#define pf2(x,y) printf("%d %d\n",x,y);
#define p3(x,y,z) printf("%d %d %d\n",x,y,z);
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define tr(x) cout<<x<< endl;
#define tr2(x,y) cout<<x<<" "<<y<<" " << endl;
#define tr3(x,y,z) cout<<x<<" "<<y<<" "<<z<<endl;
#define tr4(x,y,z,a) cout<<x<<" "<<y<<" "<<z<<  " " << a << " " << endl;
#define sz(x) (int)x.size()

// for unit capacities, running time is O(min(V^{2/3}, E^{1/2}) * E), otherwise running time is O(V^2 * E)
// This results in O(\sqrt(V) * E) for bipartite matching problem = Hopcroft Karp Algorithm

const int inf = 1e9;

struct edge {
    int x, y, cap, flow, tag;
};
int ans[N];
//1 indexed Hopcroft-Karp Matching in O(E sqrtV)

struct Hopcroft_Karp
{
	static const int inf = 1e9;

	int n;
	vector<int> matchL, matchR, dist;
	vector<vector<pair<int,int>> > g;

	Hopcroft_Karp(int n) :
		n(n), matchL(n+1), matchR(n+1), dist(n+1), g(n+1) {}

	void addEdge(int u, int v, int tag)
	{
		g[u].push_back(mp(v,tag));
	}

	bool bfs()
	{
		queue<int> q;
		for(int u=1;u<=n;u++)
		{
			if(!matchL[u])
			{
				dist[u]=0;
				q.push(u);
			}
			else
				dist[u]=inf;
		}
		dist[0]=inf;

		while(!q.empty())
		{
			int u=q.front();
			q.pop();
			for(auto p:g[u])
			{
                int v = p.fi;
				if(dist[matchR[v]] == inf)
				{
					dist[matchR[v]] = dist[u] + 1;
					q.push(matchR[v]);
				}
			}
		}

		return (dist[0]!=inf);
	}

	bool dfs(int u)
	{
		if(!u)
			return true;
		for(auto p:g[u])
		{
            int v = p.fi;
			if(dist[matchR[v]] == dist[u]+1 &&dfs(matchR[v]))
			{
				matchL[u]=v;
				matchR[v]=u;
                ans[u] = p.se;
                ans[v-n/2] = p.se;
				return true;
			}
		}
		dist[u]=inf;
		return false;
	}

	int max_matching()
	{
		int matching=0;
		while(bfs())
		{
			for(int u=1;u<=n;u++)
			{
				if(!matchL[u])
					if(dfs(u))
						matching++;
			}
		}
		return matching;
	}
};
unordered_map<int, vector<int>> mymap;
int arr[N];
int main(){
	int i,j,k,n,m,x,y,z,a,b;
	sd3(n, a, b);

	Hopcroft_Karp hkp(2*n);
	for(i=1; i<=n; i++){
	    sd(arr[i]);
        mymap[arr[i]].pb(i);
	}
    for(i=1; i<=n; i++){
        x = arr[i];
        for(auto j:mymap[a-x]){
           hkp.addEdge(i, j+n, 0);
           hkp.addEdge(j, i+n, 0);
       }

       for(auto j:mymap[b-x]){
           hkp.addEdge(i, j+n, 1);
           hkp.addEdge(j, i+n, 1);
       }
    }
	ll an = hkp.max_matching();

    // tr(an);

    if(an != n){
        tr("NO");
        return 0;
    }
    tr("YES");
	for(i=1; i<=n; i++){
        pf(ans[i]);
    }

	return 0;
}