import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.HashMap;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
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;
		FastScanner in = new FastScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
	public void solve(int testNumber, FastScanner in, PrintWriter out) {
		int n = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();
		List<Clause> clauses = new ArrayList<Clause>();
		int[] p = new int[n];
		Map<Integer, Integer> id = new HashMap<>();
		for (int i = 0; i < n; i++) {
			p[i] = in.nextInt();
			id.put(p[i], i);
		}
		// var[i] = true means p[i] \in A
		for (int i = 0; i < n; i++) {
			int x = p[i];
			Integer j = id.get(a - x);
			if (j == null) {
				// var[i] is false
				clauses.add(new Clause(i, i, true, false));
			} else {
				clauses.add(new Clause(i, j, true, true));
				clauses.add(new Clause(j, i, false, false));
			}

			j = id.get(b - x);
			if (j == null) {
				// var[i] is true
				clauses.add(new Clause(i, i, false, true));
			} else {
				clauses.add(new Clause(i, j, false, false));
				clauses.add(new Clause(j, i, true, true));
			}
		}
		SAT2Solver solver = new SAT2Solver(n);
		if (!solver.solve(clauses)) {
			out.println("NO");
			return;
		}
		out.println("YES");
		for (int i = 0; i < n; i++) {
			if (i > 0) {
				out.print(" ");
			}
			if (solver.isTrue[i]) {
				out.print(0);
			} else {
				out.print(1);
			}
		}
		out.println();
	}

	class Clause {
		int v1, v2;
		boolean neg1, neg2;

		// Example: (x=>!y) is translated to Clause(x, y, true, false)
		Clause(int v1, int v2, boolean pos1, boolean pos2) {
			this.v1 = v1;
			this.v2 = v2;
			this.neg1 = !pos1;
			this.neg2 = !pos2;
		}
	}

	class SAT2Solver {
		List<Integer>[] g;
		boolean[] isTrue;
		int n;

		int numComps;
		int[] low;
		int[] vis;
		int[] comp;
		boolean[] onStack;
		int[] stack;
		int sp;
		int globalTime;

		SAT2Solver(int n) {
			this.n = n;
			isTrue = new boolean[2 * n];
			vis = new int[2 * n];
			low = new int[2 * n];
			stack = new int[2 * n];
			comp = new int[2 * n];
			onStack = new boolean[2 * n];
			g = new List[2 * n];
		}

		public boolean solve(List<Clause> clauses) {
			for (int i = 0; i < 2 * n; i++) {
				g[i] = new ArrayList<Integer>();
			}
			for (Clause clause : clauses) {
				int v1 = clause.v1;
				int v2 = clause.v2;
				boolean neg1 = clause.neg1;
				boolean neg2 = clause.neg2;
				if (neg1) {
					v1 = negate(v1);
				}
				if (neg2) {
					v2 = negate(v2);
				}
				//g[negate(v1, n)].add(v2);
				//g[negate(v2, n)].add(v1);
				g[v1].add(v2);
			}
			Arrays.fill(vis, -1);
			Arrays.fill(onStack, false);
			sp = 0;
			globalTime = 0;
			numComps = 0;
			for (int i = 0; i < 2 * n; i++) {
				if (vis[i] < 0) {
					dfsTarjan(i);
				}
			}
			int[] firstInComp = new int[numComps];
			Arrays.fill(firstInComp, -1);
			int[] nextSameComp = new int[2 * n];
			for (int i = 0; i < 2 * n; i++) {
				int c = comp[i];
				nextSameComp[i] = firstInComp[c];
				firstInComp[c] = i;
			}
			List<Integer>[] invertedCompEdges = new List[numComps];
			for (int i = 0; i < numComps; i++) {
				invertedCompEdges[i] = new ArrayList<Integer>();
			}
			for (int i = 0; i < 2*n; i++) {
				for (int j : g[i]) {
					invertedCompEdges[comp[j]].add(comp[i]);
				}
			}
			boolean[] compIsTrue = new boolean[numComps];
			Arrays.fill(compIsTrue, true);
			for (int c = 0; c < numComps; c++) {
				if (!compIsTrue[c]) {
					continue;
				}
				for (int i = firstInComp[c]; i >= 0; i = nextSameComp[i]) {
					int nc = comp[negate(i)];
					if (c == nc) {
						return false;
					}
				}
				for (int i = firstInComp[c]; i >= 0; i = nextSameComp[i]) {
					int nc = comp[negate(i)];
					dfsReject(nc, invertedCompEdges, compIsTrue);
				}
			}
			for (int i = 0; i < 2 * n; i++) {
				isTrue[i] = compIsTrue[comp[i]];
			}
			for (int i = 0; i < n; i++) {
				if (isTrue[i] && isTrue[negate(i)]) {
					throw new AssertionError();
				}
				if (!isTrue[i] && !isTrue[negate(i)]) {
					return false;
				}
			}
			return true;
		}

		private int negate(int i) {
			return i + (i < n ? n : -n);
		}

		private void dfsReject(int c, List<Integer>[] invertedCompEdges, boolean[] compIsTrue) {
			if (!compIsTrue[c]) {
				return;
			}
			compIsTrue[c] = false;
			for (int p : invertedCompEdges[c]) {
				dfsReject(p, invertedCompEdges, compIsTrue);
			}
		}

		void dfsTarjan(int v) {
			vis[v] = globalTime;
			low[v] = globalTime;
			++globalTime;
			stack[sp++] = v;
			onStack[v] = true;
			for (int u : g[v]) {
				if (vis[u] < 0) {
					dfsTarjan(u);
					if (low[v] > low[u]) {
						low[v] = low[u];
					}
				} else if (onStack[u] && low[v] > vis[u]) {
					low[v] = vis[u];
				}
			}
			if (low[v] == vis[v]) {
				while (true) {
					int u = stack[--sp];
					onStack[u] = false;
					comp[u] = numComps;
					if (u == v) {
						break;
					}
				}
				++numComps;
			}
		}

	}

}

class FastScanner {

	private BufferedReader in;
	private StringTokenizer st;

	public FastScanner(InputStream stream) {
		in = new BufferedReader(new InputStreamReader(stream));
	}

	public String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				String rl = in.readLine();
				if (rl == null) {
					return null;
				}
				st = new StringTokenizer(rl);
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

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

}


import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

    public static void main(String[] args) {

        Scanner in = new Scanner(new BufferedInputStream(System.in));
        PrintWriter out = new PrintWriter(new BufferedWriter(
                new OutputStreamWriter(System.out)));

        while (in.hasNext()) {
            int n = in.nextInt(), a = in.nextInt(), b = in.nextInt(), c = 0;
            int[] p = new int[n];

            TreeMap<Integer, Integer> map = new TreeMap<Integer, Integer>();
            for (int i = 0; i < n; i++) {
                p[i] = in.nextInt();
                map.put(p[i], i);
            }

            if (a > b) {
                int t = b;
                b = a;
                a = t;
                c = 1;
            }

            boolean ok = true;
            int[] cls = new int[n];
            while (ok && map.size() > 0) {
                Entry<Integer, Integer> last = map.lastEntry();
                int v = last.getKey();
                int idx = last.getValue();
                if (map.containsKey(a - v)) {
                    cls[idx] = 0;
                    cls[map.get(a - v)] = 0;
                    map.remove(v);
                    map.remove(a -v);
                } else if (map.containsKey(b - v)) {
                    cls[idx] = 1;
                    cls[map.get(b - v)] = 1;
                    map.remove(v);
                    map.remove(b -v);
                } else
                    ok = false;
            }

            if (!ok)
                System.out.println("NO");
            else {
                System.out.println("YES");
                for (int j = 0; j < cls.length; j++) {
                    if (j != 0)
                        System.out.print(" ");
                    System.out.print(c ^ cls[j]);
                }
                System.out.println();
            }
            out.flush();
        }
        in.close();
    }

}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeSet;
import java.util.concurrent.LinkedBlockingDeque;

import javax.swing.border.Border;

public class a {

	public static long mod = (long) Math.pow(10, 9) + 7;
	public static int k = 0;

	private static class node implements Comparable<node> {
		int l;
		int r;
		int index;
		int index2;
		int buffer;

		node(int l, int r, int i, int b, int i2) {
			this.l = l;
			this.r = r;
			index = i;
			buffer = b;
			index2 = i2;

		}

		@Override
		public int compareTo(node o) {
			if (k == 0) {
				if (o.l < l)
					return 1;
				else if (o.l > l)
					return -1;
				else if (o.buffer != -1) {
					return 1;
				} else
					return -1;
			} else if (k == 1) {
				if (r != o.r)
					return r - o.r;
				return o.index - index;
			} else if (k == 2) {
				return r - o.r;
			} else {
				if (o.index < index)
					return 1;
				else
					return -1;
			}

		}
	}

	// private static class point implements Comparable<point> {
	// int l;
	// int r;
	// int index;
	// int buffer;
	//
	// point(int l, int r, int i, int b) {
	// this.l = l;
	// this.r = r;
	// index = i;
	// buffer = b;
	//
	// }
	//
	// @Override
	// public int compareTo(point o) {
	// if (o.l < l)
	// return 1;
	// else if (o.l > l)
	// return -1;
	// else if (o.r < r)
	// return 1;
	// else if (o.r > r)
	// return -1;
	// return 0;
	// }
	//
	// }

	public static class point implements Comparable<point> {
		long x;
		long y;

		point(long x, long y) {
			this.x = x;
			this.y = y;
		}

		@Override
		public int compareTo(point o) {
			return (int) (x - o.x);

		}
	}

	public static int ch(long y) {
		int r = Long.bitCount(y);
		return r;
	}

	public static int gcd(int x, int y) {
		if (y == 0)
			return x;

		return gcd(y, x % y);
	}

	public static int min[];
	public static int max[];

	public static void build(int s, int e, int p, int a[]) {
		if (s == e) {
			min[p] = a[s];
			max[p] = a[s];
			return;
		}

		int mid = (s + e) / 2;
		build(s, mid, p * 2, a);
		build(mid + 1, e, p * 2 + 1, a);
		min[p] = Math.min(min[p * 2], min[p * 2 + 1]);
		max[p] = Math.max(max[p * 2], max[p * 2 + 1]);
	}

	public static int getMin(int s, int e, int p, int from, int to) {
		if (s > to || e < from)
			return Integer.MAX_VALUE;
		if (s >= from && e <= to)
			return min[p];
		int mid = (s + e) / 2;

		int a = getMin(s, mid, p * 2, from, to);
		int b = getMin(mid + 1, e, p * 2 + 1, from, to);
		return Math.min(a, b);

	}

	public static int getMax(int s, int e, int p, int from, int to) {
		if (s > to || e < from)
			return Integer.MIN_VALUE;
		if (s >= from && e <= to)
			return max[p];
		int mid = (s + e) / 2;

		int a = getMax(s, mid, p * 2, from, to);
		int b = getMax(mid + 1, e, p * 2 + 1, from, to);
		return Math.max(a, b);

	}

	public static boolean ch[];
	public static ArrayList<Integer> prime;
	public static Queue<Integer> pp;

	public static void sieve(int k) {
		ch[0] = ch[1] = true;

		for (int i = 2; i <= k; i++) {
			if (!ch[i]) {
				prime.add(i);
				pp.add(i);
				for (int j = i + i; j <= k; j += i) {
					ch[j] = true;
				}
			}
		}

	}

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder qq = new StringBuilder();
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		String y[] = in.readLine().split(" ");
		int n = Integer.parseInt(y[0]);
		int a = Integer.parseInt(y[1]);
		int b = Integer.parseInt(y[2]);

		int arr[] = new int[n];
		HashMap<Integer, Integer> mp = new HashMap();
		y = in.readLine().split(" ");
		boolean flag = true;
		for (int i = 0; i < n; i++) {
			arr[i] = Integer.parseInt(y[i]);
			if (arr[i] >= a && arr[i] >= b) {
				flag = false;
			}
			mp.put(arr[i], i);
		}

		if (!flag) {
			System.out.println("NO");
			return;
		}
		boolean ch[] = new boolean[n];
		int ans[] = new int[n];

		for (int i = 0; i < n; i++) {
			int k = i;

			while (true&&!ch[k]) {

				if (mp.containsKey(a - arr[k]) && !ch[mp.get(a - arr[k])]
						&& mp.containsKey(b - arr[k])
						&& !ch[mp.get(b - arr[k])]) {
					break;
				} else if (mp.containsKey(a - arr[k])
						&& !ch[mp.get(a - arr[k])]) {
					//System.out.println(arr[k]);
					ch[k] = true;
					ans[k] = 0;
					ch[mp.get(a - arr[k])] = true;
					ans[mp.get(a - arr[k])] = 0;
					int s = b - (a - arr[k]);
					if (mp.containsKey(s)) {
						k = mp.get(s);
					} else
						break;

				} else if (mp.containsKey(b - arr[k])
						&& !ch[mp.get(b - arr[k])]) {
					ans[k] = 1;
					ans[mp.get(b - arr[k])] = 1;
					ch[k] = true;
					ch[mp.get(b - arr[k])] = true;

					int s = a - (b - arr[k]);
					if (mp.containsKey(s)) {
						k = mp.get(s);
					} else
						break;
				} else {
					// System.out.println(arr[i] + " " + i);
					System.out.println("NO");
					return;
				}
			}
		}

		qq.append("YES\n");
		for (int i = 0; i < ans.length; i++) {
			qq.append(ans[i] + " ");
		}
		System.out.println(qq);

	}
}


import java.util.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class Main{

	// ArrayList<Integer> lis = new ArrayList<Integer>();
	// ArrayList<String> lis = new ArrayList<String>();
	//  PriorityQueue<P> que = new PriorityQueue<P>();
	// PriorityQueue<Integer> que = new PriorityQueue<Integer>();
	//  Stack<Integer> que = new Stack<Integer>();
	//HashMap<Long,Long> map = new HashMap<Long,Long>();
    //	static long sum=0;
	// 1000000007 (10^9+7)
	static int mod = 1000000007;
	//static int mod = 1000000009,r=0; ArrayList<Integer> l[]= new ArrayList[n];
   // static int dx[]={1,-1,0,0};
//	static int dy[]={0,0,1,-1};
//	static int dx[]={1,-1,0,0,1,1,-1,-1};
//  static int dy[]={0,0,1,-1,1,-1,1,-1};
	//static Set<Integer> set = new HashSet<Integer>();p

	static ArrayList<Integer> cd[];
	static int K=0;

public  static void main(String[] args)   throws Exception, IOException{
   //String line=""; throws Exception, IOException
   //(line=br.readLine())!=null
	//Scanner sc =new Scanner(System.in);
	// !!caution!! int long //
	Reader sc = new Reader(System.in);

 //,a=sc.nextInt(),b=sc.nextInt();
 	// int n=sc.nextInt(),p[]=new int[n],q[]=new int[n];
	//int n=sc.nextInt(),a[]=new int[n],b[]=new int[n];
 // int n=sc.nextInt(),m=sc.nextInt(),a=sc.nextInt(),b=sc.nextInt();
	// int r=1<<28;

	int n=sc.nextInt();//,k=sc.nextInt();
    int a=sc.nextInt(),b=sc.nextInt(),d[]=new int[n];
    HashMap<Integer,Integer> map = new HashMap<Integer,Integer>();
    ArrayList<Integer> A = new ArrayList<Integer>();

    for (int i = 0; i < n ; i++) {

    	d[i]=sc.nextInt();
    	map.put(d[i],i );

    }

    int c=1;
	 if( a>b ){c--; int x=a; a=b; b=x;}

	 int r[]=new int[n];

	 if(a==b){

		  for (int i = 0; i < n; i++) {
			  if(d[i]>a || !map.containsKey(a-d[i]) ){System.out.println("NO"); return;}
		  }
System.out.println("YES");
		  for (int i = 0; i < n; i++) {System.out.print("1 ");}
		  System.out.println();
		 return;
	 }

       sort(d);

    for (int j = 0; j < n; j++) {
         int i=n-j-1;
    	int id=map.get(d[i]),idd=-1;
    	if(  id<0)continue;

    //	db(id,d[i]);

    	if( d[i]<=a ){
    		 if( map.containsKey(a-d[i]) && 0<=(idd=map.get(a-d[i]))  ){
    		r[id]=r[idd]=(c+1)%2;
    		map.put(a-d[i], -1);
    		 }
    		 else if( map.containsKey(b-d[i]) && 0<=(idd=map.get(b-d[i])) ){
    	    		r[id]=r[idd]=c;
    	    		map.put(b-d[i], -1); }
    		else{ System.out.println("NO"); return; }

    	}

    	else{

    		if( map.containsKey(b-d[i]) && 0<=(idd=map.get(b-d[i]))   ){
    			r[id]=r[idd]=c;
    		map.put(b-d[i], -1); }
    		else{ System.out.println("NO"); return; }

    	}
    	map.put(d[i], -1);

    }
    	System.out.println("YES");
         for (int j = 0; j < n; j++) {
			System.out.print(r[j]+" ");
		}
    	System.out.println();

}

  static class P implements Comparable<P>{
//	implements Comparable<Pair>
	int id; long  d; ;
	P(int id,long d){
		this.id=id;
		this.d=d;
	}

	public int compareTo(P x){
		return  (-x.d+d)>=0?1:-1  ; // ascend long
	//	return   -x.d+d  ; // ascend
	//	 return   x.d-d  ; //descend
	   }

}

static void db(Object... os){
    System.err.println(Arrays.deepToString(os));

}

}

class Reader
{
	private BufferedReader x;
	private StringTokenizer st;

	public Reader(InputStream in)
	{
		x = new BufferedReader(new InputStreamReader(in));
		st = null;
	}
	public String nextString() throws IOException
	{
		while( st==null || !st.hasMoreTokens() )
			st = new StringTokenizer(x.readLine());
		return st.nextToken();
	}
	public int nextInt() throws IOException
	{
		return Integer.parseInt(nextString());
	}
	public long nextLong() throws IOException
	{
		return Long.parseLong(nextString());
	}
	public double nextDouble() throws IOException
	{
		return Double.parseDouble(nextString());
	}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Stack;
import java.util.StringTokenizer;

public class TwoSets {
    static int n, a, b;
    static HashSet<Integer> arr = new HashSet<Integer>();
    static HashSet<Integer> visited = new HashSet<Integer>();
    static HashMap<Integer, Integer> result = new HashMap<Integer, Integer>();

    static void dfs(int x, int parent, int len) {
        stack.push(x);
        visited.add(x);
        int children = 0;
        if (a - x > 0) {
            if (a - x != parent && arr.contains(a - x)) {
                dfs(a - x, x, len + 1);
                children++;
            }
        }
        if (b - x > 0) {
            if (b - x != parent && arr.contains(b - x)) {
                dfs(b - x, x, len + 1);
                children++;
            }
        }
        if (children == 0) {
            if (len % 2 == 1) {
                System.out.println("NO");
                System.exit(0);
            } else {
                while (!stack.isEmpty()) {
                    int first = stack.pop();
                    int second = stack.pop();
                    if (first == a - second) {
                        result.put(first, 0);
                        result.put(second, 0);
                    } else {
                        result.put(first, 1);
                        result.put(second, 1);
                    }

                }
            }
        }
    }

    static Stack<Integer> stack = new Stack<Integer>();

    public static void main(String[] args) {
        InputReader r = new InputReader(System.in);
        n = r.nextInt();
        a = r.nextInt();
        b = r.nextInt();
        int[] list = new int[n];
        for (int i = 0; i < n; i++) {
            list[i] = r.nextInt();
            arr.add(list[i]);
        }
        for (int x : arr) {
            if (!visited.contains(x)) {
                if (arr.contains(a - x) && arr.contains(b - x))
                    continue;
                if (arr.contains(a - x) || arr.contains(b - x)) {
                    dfs(x, -1, 1);
                } else {
                    System.out.println("NO");
                    System.exit(0);
                }
            }
        }
        PrintWriter out = new PrintWriter(System.out);
        out.println("YES");
        for (int i = 0; i < list.length; i++) {
            if (result.get(list[i]) == null)
                out.println(0);
            else
                out.println(result.get(list[i]));
        }
        out.close();

    }

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

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

        public InputReader(FileReader stream) {
            reader = new BufferedReader(stream);
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                return null;
            }
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;
import static java.lang.Integer.*;

public class BDiv1 {
static int n;
static int a;
static int b;
static HashMap<Integer,Integer> graphA=new HashMap<>();
static HashMap<Integer,Integer> graphB=new HashMap<>();
static int [] array;
static int [] original;
static boolean x=true;

    public static void main(String[] args) throws Exception{
        BufferedReader buf =new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st =new StringTokenizer(buf.readLine());
        n=parseInt(st.nextToken());
        a=parseInt(st.nextToken());
        b=parseInt(st.nextToken());
        st =new StringTokenizer(buf.readLine());
        array=new int[n];
        original=new int [n];
        for (int i=0;i<n;i++){
            array[i]=parseInt(st.nextToken());
            original[i]=array[i];
        }
        Arrays.sort(array);
for (int i=0;i<n;i++){
    int k= Arrays.binarySearch(array,a-array[i]);
    if (k>=0){
        graphA.put(array[i],array[k]);
        graphA.put(array[k],array[i]);
    }
}
for (int i=0;i<n;i++){
    int k= Arrays.binarySearch(array,b-array[i]);
    if (k>=0){
        graphB.put(array[i],array[k]);
        graphB.put(array[k],array[i]);
    }
    }

for (int i=0;i<n;i++){
    Integer j=graphA.get(array[i]);
    if (j!=null){
        if (graphB.containsKey(array[i]) && graphB.containsKey(j)){
            graphA.remove(array[i]);
            graphA.remove(j);
        }
        else if (graphB.containsKey(array[i]) && !graphB.containsKey(j)){

            graphB.remove(graphB.get(array[i]));
            graphB.remove(array[i]);
        }
        else if (!graphB.containsKey(array[i]) && graphB.containsKey(j)){
            graphB.remove(graphB.get(j));
            graphB.remove(j);
        }

    }

}

int [] res=new int [n];
for (int i=0;i<n;i++){
    if (graphA.containsKey(original[i]))res[i]=0;
    else if (graphB.containsKey(original[i])) res[i]=1;
    else {
        System.out.println("NO");
        return;
    }
}
System.out.println("YES");
for (int k:res)System.out.print(k+" ");
}

    }


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

public class Main
{
	static HashMap<Integer,Integer> hm;
	static int[] array;
	static boolean marked[];
	static int a , b ;
	static int[] ans ;

	public static void main( String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n ;

		n = sc.nextInt();
		a = sc.nextInt();
		b = sc.nextInt();

		hm = new HashMap<Integer,Integer>();
		array = new int[n];
		marked = new boolean[n];

		for( int i = 0 ; i < n ; ++i )
		{
			array[i] = sc.nextInt();
			hm.put( array[i] , i );
		}

		if( a == b)
		{
			boolean flag = true ;
			for( int i = 0 ; i < n ; ++i )
				if( !hm.containsKey( a - array[i]))
					flag = false;

			if( !flag)
				System.out.println( "NO");
			else
			{
				System.out.println("YES");
				for( int i = 0 ; i < n ; ++i)
					System.out.print("0 ");
			}
		}

		else
		{

			ans = new int[n];

			for( int i = 0 ; i < n ; ++i )
			if( marked[i] ) continue;

			else  // hadle odd , even and single self loops
			{
				if( hm.containsKey(a - array[i]) && !hm.containsKey(b - array[i]))
				{
					propagateA(i);
				}

				else if( !hm.containsKey(a - array[i]) && hm.containsKey(b - array[i]))
				{
					// propagate b
					propagateB(i);
				}

				else if(!hm.containsKey(a - array[i]) && !hm.containsKey(b - array[i]))
				{
					System.out.println("NO");
					System.exit(0);
				}
			}

			for( int i = 0 ; i < n ; ++i )
				if( marked[i] ) continue;

				else  // handle doule self loops , cycles
				{
						start(i);
				}

			System.out.println("YES");
			for( int i = 0 ; i < n; ++i)
				System.out.print(ans[i] + " ");
			System.exit(0);
		}

	}

	static void propagateA(int index)
	{

		int i = index;

		while( !marked[i])
		{

					if( hm.containsKey( a - array[i]) && !marked[ hm.get( a - array[i])])
					{
						marked[i] = true ;
						ans [i] = 0 ;

						i = hm.get( a - array[i]);
						marked[i] = true ;
						ans [i] = 0 ;

						if( hm.containsKey( b - array[i]) && !marked[ hm.get( b - array[i])])
						{
							i = hm.get( b - array[i]);
						}

					}

					else
					{
						System.out.println("NO");
						System.exit(0);
					}

		}

	}

	static void propagateB(int index)
	{

		int i = index;

		while( !marked[i])
		{

					if( hm.containsKey( b - array[i]) && !marked[ hm.get( b - array[i])])
					{
						marked[i] = true ;
						ans [i] = 1 ;

						i = hm.get( b - array[i]);
						marked[i] = true ;
						ans [i] = 1 ;

						if( hm.containsKey( a - array[i]) && !marked[ hm.get( a - array[i])])
						{
							i = hm.get( a - array[i]);
						}

					}

					else
					{
						System.out.println("NO");
						System.exit(0);
					}

		}

	}

	static void start(int index)
	{

		int i = index ;

		while( !marked[i] )
		{
			//System.out.println( a - array[i]);
			if(!marked[ hm.get( a - array[i])])
			{
				marked[i] = true ;
				ans [i] = 0 ;

				i = hm.get( a - array[i]);
				marked[i] = true ;
				ans [i] = 0 ;

				i = hm.get( b - array[i]);

			}

		}
	}

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class B {
	static Set<Integer> A;
	static Set<Integer> B;
	static TreeSet<Integer> ts;
	static int a;
	static int b;
	static boolean noAns;
	public static void main(String[] args) throws Exception{
		int n = readInt();
		a = readInt();
		b = readInt();
		ts = new TreeSet<Integer>();
		int[] table = new int[n];
		for(int i = 0; i<n; i++){
			table[i] = readInt();
			ts.add(table[i]);
		}
		A = new HashSet<Integer>();
		B = new HashSet<Integer>();
		noAns = false;
		for(Integer cur:ts){
			boolean fitsA = false;
			boolean fitsB = false;
			if(A.contains(cur) || B.contains(cur)){
				continue;
			}
			if(ts.contains(a-cur)){
				fitsA = true;
			}
			if(ts.contains(b-cur)){
				fitsB = true;
			}
			if(fitsA && fitsB){
				continue;
			}
			else if(!(fitsA || fitsB)){
				noAns = true;
			}
			else if(fitsA){
				tour(cur, false);
			}
			else if(fitsB){
				tour(cur, true);
			}
		}
		for(Integer cur:ts){
			if(A.contains(cur) || B.contains(cur)){
				continue;
			}
			else{
				A.add(cur);
			}
		}
		if(!noAns){
			System.out.println("YES");
			StringBuilder sb = new StringBuilder();
			for(int i = 0; i< n; i++){
				if(A.contains(table[i])){
					sb.append("0");
				}
				else{
					sb.append("1");
				}
				sb.append(" ");
			}
			System.out.println(sb);
		}
		else{
			System.out.println("NO");
		}
	}

	static void tour(Integer cur, boolean bb){
		if(A.contains(cur) || B.contains(cur)){
			return;
		}
		if(bb){
			B.add(cur);
			B.add(b-cur);

			if(ts.contains(a-cur)){
				B.add(a-cur);
				if(ts.contains(b-(a-cur))){
					tour(b-(a-cur), true);
				}
				else{
					noAns = true;
				}
			}
			if(ts.contains(a-(b-cur))){
				B.add(a-(b-cur));
				if(ts.contains(b-(a-(b-cur)))){
					tour(b-(a-(b-cur)), true);
				}
				else{
					noAns = true;
				}
			}
		}
		else{
			A.add(cur);
			A.add(a-cur);
			if(ts.contains(b-cur)){
				A.add(b-cur);
				if(ts.contains(a-(b-cur))){
					tour(a-(b-cur), false);
				}
				else{
					noAns = true;
				}
			}
			if(ts.contains(b-(a-cur))){
				A.add(b-(a-cur));
				if(ts.contains(a-(b-(a-cur)))){
					tour(a-(b-(a-cur)), false);
				}
				else{
					noAns = true;
				}
			}
		}
	}

	static BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
	static StringTokenizer st = new StringTokenizer(" ");
	static String readString() throws Exception{
		while(!st.hasMoreTokens()){
			st = new StringTokenizer(stdin.readLine());
		}
		return st.nextToken();
	}
	static int readInt() throws Exception {
		return Integer.parseInt(readString());
	}
	static long readLong() throws Exception {
		return Long.parseLong(readString());
	}
}


import java.text.DecimalFormat;
import java.io.*;
import java.util.*;
import java.lang.reflect.Array;

/**
 * @author Mukesh Singh
 *
 */

public class AB {

    private InputStream input;
    private PrintStream output;
    private Scanner inputSc;

    public AB(InputStream input, PrintStream output) {
        this.input = input;
        this.output = output;
        init();
    }

    private void init() {
        inputSc = new Scanner(input);
    }

    static int lineToInt(String line) {
        return Integer.parseInt(line);
    }

    static long lineToLong(String line) {
        return Long.parseLong(line);
    }
    static double lineToDouble(String line) {
        return Double.parseDouble(line);
    }

    public void solve()
	{
            solveTestCase();
    }

/**
 * @define global / instance variables
 */

	HashMap<Integer,Integer> mat ;
	long dist[] ;
	int vec[] ;
	int ar[] ;
	Set<Integer> st ;
	boolean isDone[] ;
	final long INF = 100000000000000000L ;
/**
 * @solve test case
 */
@SuppressWarnings("unchecked")
   private void solveTestCase()
	{
		int i , j  , k , n , m , d , l ,b  , p , q , r;
		long N , M, K;
		int x1 , y1 , x2 , y2 ,x;
		int a1,a2,b1,b2,a ;
		DecimalFormat df = new DecimalFormat("#,###,##0.00");
        String str = inputSc.nextLine();
        String delims = "[ ]+";
		String tokens[] = str.split(delims);
		n = lineToInt(tokens[0]);
		a = lineToInt(tokens[1]);
		b = lineToInt(tokens[2]);
		mat = new HashMap<Integer,Integer>() ;
		st = new TreeSet<Integer>();
		ar = new int[n+4] ;
		vec = new int[n+4] ;
		str = inputSc.nextLine();
		tokens = str.split(delims);
		for( i = 1 ; i <= n ; i++ )
		{
			ar[i] = lineToInt(tokens[i-1]);
			mat.put(ar[i],i) ;
			st.add(ar[i]);
			vec[i] = i ;
		}
		vec[n+1] = n+1 ;
		vec[n+2] = n+2 ;
		for( i = 1 ; i <= n ; i++ )
		{
			x= ar[i];

			if(st.contains(a-x))
			{
				Bing(mat.get(x),mat.get(a-x));
			}
			else
				Bing(n+1 , mat.get(x));
			if(st.contains(b-x))
			{
				Bing(mat.get(x),mat.get(b-x));
			}
			else
				Bing(n+2 , mat.get(x));
		}
		if(find(n+1)==find(n+2))
		{
			output.println("NO");
			return ;
		}
		output.println("YES");
		for( i =1 ;  i<= n  ; i ++ )
		{
			if(find(i)==find(n+1))
				output.print("1 ");
			else
				output.print("0 ");
		}
		output.println();

	}
	int find(int x)
{
	if(x==vec[x]) return x;
	return vec[x]=find(vec[x]);
}

void Bing(int a,int b)
{
	int A=find(a);int B=find(b);
	if(A==B) return ;
	vec[B]=A;
}

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
	{
		FileInputStream in = null;
      	FileOutputStream out = null;
		PrintStream ps = null ;
		InputStream is = null ;
		try
		{
         	is = new FileInputStream("file.in");
         	out = new FileOutputStream("file.out");
			ps = new PrintStream(out);
        }
		catch ( Exception e )
		{}

        AB sd = new AB(System.in, System.out);
        sd.solve();
		try
		{
        if (is != null)
		{
	      is.close();
	    }
       	if (out != null) {
           	out.close();
       	}
		if (ps != null) {
           	ps.close();
         }
      	}catch (Exception e){}

		//SquareDetector sd = new SquareDetector(System.in, System.out);
        //sd.solve();
    }
}


import java.util.*;
import java.io.*;
public class B {
    public static PrintStream out = System.out;
    public static InputReader in = new InputReader(System.in);
    static class Node implements Comparable<Node> {
        int res;
        Node(int pp) {
            p = pp;
        }
        int p;
        @Override
        public int compareTo(Node n) {
            return Integer.compare(p, n.p);
        }
        @Override
        public boolean equals(Object o) {
            return p == ((Node) o).p;
        }
    }
    public static void main(String args[]) {
        int N, a, b;
        N = in.nextInt();
        int[] label;
        a = in.nextInt();
        b = in.nextInt();
        if (a < b) {
            label = new int[] {0, 1};
        } else {
            int tmp = a;
            a = b;
            b = tmp;
            label = new int[] {1, 0};
        }
        Node[] nodes = new Node[N];
        for (int i = 0; i < N; i++) {
            nodes[i] = new Node(in.nextInt());
        }
        TreeSet<Node> ts = new TreeSet<>();
        for (int i = 0; i < N; i++) {
            ts.add(nodes[i]);
        }
        while (!ts.isEmpty()) {
            Node n = ts.first();
            Node an = new Node(a - n.p);
            Node bn = new Node(b - n.p);
            SortedSet<Node> ats = ts.tailSet(an);
            SortedSet<Node> bts = ts.tailSet(bn);
            Node an2 = ats.isEmpty() ? null : ats.first();
            Node bn2 = bts.isEmpty() ? null : bts.first();
            Node n2 = null;
            int l = 0;
            if (bn2 != null && bn2.equals(bn)) {
                n2 = bn2;
                l = label[1];
            } else if (an2 != null && an2.equals(an)) {
                n2 = an2;
                l = label[0];
            } else {
                NO();
            }
            if (!n.equals(n2)) {
                ts.remove(n);
                n.res = l;
            }
            ts.remove(n2);
            n2.res = l;
        }
        out.println("YES");
        for (int i = 0; i < nodes.length; i++) {
            if (i != 0) out.print(" ");
            out.print(nodes[i].res);
        }
        out.println();
    }
    static void NO() {
        out.println("NO");
        System.exit(0);
    }
}
class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;
    public InputReader(InputStream stream) {
	reader = new BufferedReader(new InputStreamReader(stream), 32768);
	tokenizer = null;
    }
    public String next() {
	while (tokenizer == null || !tokenizer.hasMoreTokens()) {
	    try {
		tokenizer = new StringTokenizer(reader.readLine());
	    } catch (IOException e) {
		throw new RuntimeException(e);
	    }
	}
	return tokenizer.nextToken();
    }
    public double nextDouble() {
	return Double.parseDouble(next());
    }
    public long nextLong() {
	return Long.parseLong(next());
    }
    public int nextInt() {
	return Integer.parseInt(next());
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class ProblemB3 {
    Map<Integer, List<int[]>> dest;

    private ProblemB3() throws IOException {
        BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
        String h = rd.readLine();
        String[] q = h.split("\\s+");
        int a = Integer.parseInt(q[1]);
        int b = Integer.parseInt(q[2]);
        h = rd.readLine();
        q = h.split(" ");
        int n = q.length;
        int[] p = new int[n];
        for(int i=0;i<n;i++) {
            p[i] = Integer.parseInt(q[i]);
        }
        Set<Integer> pset = new HashSet<>();
        for(int x: p) {
            pset.add(x);
        }
        dest = new HashMap<>();
        boolean res = true;
        for(int x: p) {
            boolean aOk = pset.contains(a-x);
            boolean bOk = pset.contains(b-x);
            if(!aOk && !bOk) {
                res = false;
                break;
            } else {
                if(aOk) {
                    addEdgeAndBack(x,a-x,0);
                }
                if(bOk) {
                    addEdgeAndBack(x,b-x,1);
                }
            }
        }
        Set<Integer> aSet = new HashSet<>();

        if(res && a != b) {
            for(int x: p) {
                List<int[]> e = getEdges(x);
                if(e.size() == 1) {
                    int[] edge = e.get(0);
                    boolean odd = true;
                    int curA = edge[1];
                    int prev = x;
                    while(true) {
                        int cur = edge[0];
                        if(curA == 0 && odd) {
                            aSet.add(prev);
                            aSet.add(cur);
                        }
                        e = getEdges(cur);
                        if(e.size() == 1) {
                            if(!odd && e.get(0)[0] != cur) {
                                res = false;
                            }
                            break;
                        }
                        int other = e.get(0)[0] == prev?1:0;
                        edge = e.get(other);
                        if(edge[1] == curA) {
                            res = false;
                            break;
                        }
                        curA = 1-curA;
                        prev = cur;
                        odd = !odd;
                    }
                    if(!res) {
                        break;
                    }
                }
            }
        }
        out(res?"YES":"NO");
        if(res) {
            StringBuilder buf = new StringBuilder();
            for(int i=0;i<n;i++) {
                if(i>0) {
                    buf.append(' ');
                }
                buf.append(aSet.contains(p[i])?'0':'1');
            }
            out(buf);
        }
    }

    private void addEdgeAndBack(int from, int to, int u) {
        addEdge(from, to, u);
        addEdge(to, from, u);
    }

    private void addEdge(int from, int to, int u) {
        List<int[]> edges = getEdges(from);
        for(int[] edge: edges) {
            if(edge[0] == to) {
                return;
            }
        }
        edges.add(new int[]{to, u});
    }

    private List<int[]> getEdges(int from) {
        List<int[]> ds = dest.get(from);
        if(ds == null) {
            ds = new ArrayList<>();
            dest.put(from, ds);
        }
        return ds;
    }

    private static void out(Object x) {
        System.out.println(x);
    }

    public static void main(String[] args) throws IOException {
        new ProblemB3();
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class B {
	BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;

	public void solve() throws IOException {
		int N = nextInt();
        int A = nextInt();
        int B = nextInt();

        int[] nsA = new int[N];
        int[] nsB = new int[N];
        char[] ans = new char[N];

        Arrays.fill(nsA, -1);
        Arrays.fill(nsB, -1);
        Arrays.fill(ans, 'C');

        HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
        int[] P = new int[N];
		for (int i = 0; i < N; i++) {
            P[i] = nextInt();
            map.put(P[i], i);
        }

        // if A == B
        if (A == B) {
            for (int i = 0; i < N; i++) {
                if (!map.containsKey(A - P[i])) {
                    out.println("NO"); return;
                }
            }

            out.println("YES");
            for (int i = 0; i < N; i++) {
                out.print(0 + " ");
            }
            out.println();
            return;
        }

        for (int i = 0; i < N; i++) {
            int oppA = A - P[i];
            int oppB = B - P[i];

            if (map.containsKey(oppA)) {
                nsA[i] = map.get(oppA);
            }

            if (map.containsKey(oppB)) {
                nsB[i] = map.get(oppB);
            }
        }

        for (int i = 0; i < N; i++) {
            if (nsA[i] == -1 && nsB[i] == -1) {
                out.println("NO");
                return;
            }
        }

        for (int i = 0; i < N; i++) {
            if (ans[i] != 'C') continue;

            if (nsA[i] == -1) {
                if (!go(i, 'B', ans, nsA, nsB) ){
                    out.println("NO"); return;
                }
            } else if (nsB[i] == -1) {
                if (!go(i, 'A', ans, nsA, nsB) ){
                    out.println("NO"); return;
                }
            }
        }

        for (int i = 0; i < N; i++) {
            if (ans[i] != 'C') continue;

            if (nsA[i] == i || nsB[i] == i) {
                if (nsA[i] == i) {
                    if (!go(i, 'B', ans, nsA, nsB) ){
                        out.println("NO"); return;
                    }
                } else {
                    if (!go(i, 'A', ans, nsA, nsB) ){
                        out.println("NO"); return;
                    }
                }
            }
        }

        for (int i = 0; i < N; i++) {
            if (ans[i] != 'C') continue;

            if (!go(i, 'A', ans, nsA, nsB) ){
                out.println("NO"); return;
            }
        }

        for (int i = 0; i < N; i++) {
            if (ans[i] == 'C') {
                out.println("NO");
                return;
            }
        }

        out.println("YES");
        for (int i = 0; i < N; i++) {
            out.print(ans[i] == 'A'? 0: 1);
            out.print(" ");
        }
        out.println();
	}

    public boolean go(int cur, char link, char[] ans, int[] nsA, int[] nsB) {
        while (ans[cur] == 'C') {
            int next = link == 'A'? nsA[cur]: nsB[cur];

            if (next == -1) return false;
            if (ans[next] != 'C') return false;
            ans[cur] = link;
            ans[next] = link;

            int nextNext = link == 'A'? nsB[next]: nsA[next];
            cur = nextNext;

            if (cur == -1) return true;

        }

        return true;
    }

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new B().run();
	}

	public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            out = new PrintWriter(System.out);
            solve();
            reader.close();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

}


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

public class Main {

	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

	static int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	static long nextLong() throws NumberFormatException, IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	static String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		writer = new PrintWriter(System.out);
		pineapple();
		reader.close();
		writer.close();
	}

	static void pineapple() throws NumberFormatException, IOException {
		int n = nextInt();
		int a = nextInt();
		int b = nextInt();
		TreeSet<Integer> al = new TreeSet<Integer>();
		TreeMap<Integer, Integer> mp = new TreeMap<Integer, Integer>();
		int[] ans = new int[n];
		Arrays.fill(ans, -1);
		TreeSet<Integer> used = new TreeSet<Integer>();
		int[] mas = new int[n];

		for (int i = 0; i < n; i++) {
			int t = nextInt();
			al.add(t);
			mas[i] = t;
			mp.put(t, i);
		}

		for (int st : al) {
			if (used.contains(st))
				continue;

			{
				int pr = st;
				int cc = -1;
				TreeSet<Integer> u2 = new TreeSet<Integer>();
				u2.add(pr);
				if (al.contains(a - pr) && !u2.contains(a - pr))
					cc = a - pr;
				else if (al.contains(b - pr) && !u2.contains(a - pr))
					cc = b - pr;
				if (cc != -1) {
					u2.add(cc);
					boolean bGo = true;
					while (bGo) {
						bGo = false;
						int nxt = -1;
						if (al.contains(a - cc) && !u2.contains(a - cc))
							nxt = a - cc;
						else if (al.contains(b - cc) && !u2.contains(b - cc))
							nxt = b - cc;
						if (nxt != -1) {
							bGo = true;
							u2.add(nxt);
							cc = nxt;
							pr = cc;
						}
					}
					st = cc;
				}
			}

			int x = st;
			while (x != -1) {
				int curr = x;
				used.add(curr);
				x = -1;
				int next1 = a - curr;
				if (al.contains(next1)) {
					if (!used.contains(next1)) {
						x = next1;
						int ci = mp.get(curr);
						int ni = mp.get(next1);
						if (ans[ci] == -1 && ans[ni] == -1) {
							ans[ni] = 0;
							ans[ci] = 0;
						}
					}
				}
				int next2 = b - curr;
				if (al.contains(next2)) {
					if (!used.contains(next2)) {
						x = next2;
						int ci = mp.get(curr);
						int ni = mp.get(next2);
						if (ans[ci] == -1 && ans[ni] == -1) {
							ans[ni] = 1;
							ans[ci] = 1;
						}
					}
				}
			}
		}

		for (int i = 0; i < n; i++) {
			if (ans[i] == -1) {
				if (2 * mas[i] == a) {
					ans[i] = 0;
					continue;
				}
				if (2 * mas[i] == b) {
					ans[i] = 1;
					continue;
				}
				writer.println("NO");
				return;
			}
		}

		writer.println("YES");
		for (int i = 0; i < n; i++) {
			writer.print(ans[i] + " ");
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Queue;
import java.util.StringTokenizer;

public class CF268_TwoSets {

	public static void main(String[] args) {

		MyScanner in = new MyScanner();

		int N = in.nextInt();
		int a = in.nextInt();
		int b = in.nextInt();

		int[] vals = new int[N];
		HashMap<Integer, Integer> val2Ind = new HashMap<Integer, Integer>();
		for (int i = 0; i < N; i++) {
			vals[i] = in.nextInt();
			val2Ind.put(vals[i], i);
		}

		int[] setAssignment = new int[N];
		int[] friendA = new int[N];
		int[] friendB = new int[N];
		Arrays.fill(setAssignment, -1);
		Arrays.fill(friendA, -1);
		Arrays.fill(friendB, -1);

		// Mark partners
		for (int i = 0; i < N; i++) {
			Integer friendAInd = val2Ind.get(a - vals[i]);
			if (friendAInd != null) {
				friendA[i] = friendAInd;
			}

			Integer friendBInd = val2Ind.get(b - vals[i]);
			if (friendBInd != null) {
				friendB[i] = friendBInd;
			}
		}

		// Find those with only one friend
		Queue<Integer> toProc = new ArrayDeque<Integer>();
		for (int i = 0; i < N; i++) {
			int friends = 0;
			if (friendA[i] != -1) {
				friends++;
			}
			if (friendB[i] != -1) {
				friends++;
			}
			if (friends == 1) {
				toProc.add(i);
			}
		}

		// Process the one frienders
		while (!toProc.isEmpty()) {

			int ind = toProc.poll();

			if (setAssignment[ind] != -1) {
				continue;
			}

			if (friendA[ind] != -1) {

				int other = friendA[ind];
				if (setAssignment[other] == -1) {
					setAssignment[ind] = 0;
					setAssignment[other] = 0;
					// Check other's friend
					if (friendB[other] != -1) {
						int otherOther = friendB[other];
						friendB[otherOther] = -1;
						toProc.add(otherOther);
					}
				} else {
					System.out.println("NO");
					return;
				}

			}

			else if (friendB[ind] != -1) {

				int other = friendB[ind];
				if (setAssignment[other] == -1) {
					setAssignment[ind] = 1;
					setAssignment[other] = 1;
					// Check other's friend
					if (friendA[other] != -1) {
						int otherOther = friendA[other];
						friendA[otherOther] = -1;
						toProc.add(otherOther);
					}
				} else {
					System.out.println("NO");
					return;
				}

			}

			else {
				System.out.println("NO");
				return;
			}

		}

		// Process those with two friends
		for(int i = 0; i < N; i++) {

			if(setAssignment[i] != -1) {
				continue;
			}

			if(friendA[i] == -1 && friendB[i] == -1) {
				System.out.println("NO");
				return;
			}

			// Only possibility should now be that both friends are possible
			setAssignment[i] = 0;
			setAssignment[friendA[i]] = 0;
		}

		// Print the result
		System.out.println("YES");
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < N; i++) {
			sb.append(setAssignment[i]);
			sb.append(" ");
		}
		sb.deleteCharAt(sb.length() - 1);
		System.out.println(sb);
	}

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

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

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class ProblemB {
    Map<Integer, List<int[]>> dest;

    private ProblemB() throws IOException {
        BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
        String h = rd.readLine();
        String[] q = h.split("\\s+");
        int a = Integer.parseInt(q[1]);
        int b = Integer.parseInt(q[2]);
        h = rd.readLine();
        q = h.split(" ");
        int n = q.length;
        int[] p = new int[n];
        for(int i=0;i<n;i++) {
            p[i] = Integer.parseInt(q[i]);
        }
        Set<Integer> pset = new HashSet<>();
        for(int x: p) {
            pset.add(x);
        }

        if(a == b) {
            boolean res = true;
            for(int x: p) {
                if(!pset.contains(a-x)) {
                    res = false;
                    break;
                }
            }
            out(res?"YES":"NO");
            if(res) {
                StringBuilder buf = new StringBuilder();
                for(int i=0;i<n;i++) {
                    if(i > 0) {
                        buf.append(' ');
                    }
                    buf.append('0');
                }
                out(buf);
            }
        } else {
            dest = new HashMap<>();
            boolean res = true;
            for(int x: p) {
                boolean aOk = pset.contains(a-x);
                boolean bOk = pset.contains(b-x);
                if(!aOk && !bOk) {
                    res = false;
                    break;
                } else {
                    if(aOk) {
                        addEdgeAndBack(x,a-x,0);
                    }
                    if(bOk) {
                        addEdgeAndBack(x,b-x,1);
                    }
                }
            }
            Set<Integer> aSet = new HashSet<>();
            if(res) {
                for(int x: p) {
                    List<int[]> e = getEdges(x);
                    if(e.size() == 1) {
                        int[] edge = e.get(0);
                        if(edge[0] == x) {
                            if(edge[1] == 0) {
                                aSet.add(x);
                            }
                        } else {
                            boolean odd = true;
                            int curA = edge[1];
                            int prev = x;
                            while(true) {
                                int cur = edge[0];
                                if(curA == 0 && odd) {
                                    aSet.add(prev);
                                    aSet.add(cur);
                                }
                                e = getEdges(cur);
                                if(e.size() == 1) {
                                    if(!odd && e.get(0)[0] != cur) {
                                        res = false;
                                    }
                                    break;
                                }
                                int other = e.get(0)[0] == prev?1:0;
                                edge = e.get(other);
                                if(edge[1] == curA) {
                                    res = false;
                                    break;
                                }
                                curA = 1-curA;
                                prev = cur;
                                odd = !odd;
                            }
                            if(!res) {
                                break;
                            }
                        }
                    }
                }
            }
            out(res?"YES":"NO");
            if(res) {
                StringBuilder buf = new StringBuilder();
                for(int i=0;i<n;i++) {
                    if(i>0) {
                        buf.append(' ');
                    }
                    buf.append(aSet.contains(p[i])?'0':'1');
                }
                out(buf);
            }
        }
    }

    private void addEdgeAndBack(int from, int to, int u) {
        addEdge(from, to, u);
        addEdge(to, from, u);
    }

    private void addEdge(int from, int to, int u) {
        List<int[]> edges = getEdges(from);
        for(int[] edge: edges) {
            if(edge[0] == to) {
                return;
            }
        }
        edges.add(new int[] { to, u });
    }

    private List<int[]> getEdges(int from) {
        List<int[]> ds = dest.get(from);
        if(ds == null) {
            ds = new ArrayList<>();
            dest.put(from, ds);
        }
        return ds;
    }

    private static void out(Object x) {
        System.out.println(x);
    }

    public static void main(String[] args) throws IOException {
        new ProblemB();
    }
}


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

public class Main {

    static BufferedReader reader;
    static StringTokenizer tokenizer;
    static PrintWriter writer;

    static int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    static long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

    static double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    static String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    public static void main(String[] args) throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new PrintWriter(System.out);
        pineapple();
        reader.close();
        writer.close();
    }

    static void pineapple() throws NumberFormatException, IOException {
        int n = nextInt();
        int a = nextInt();
        int b = nextInt();
        HashSet<Integer> al = new HashSet<Integer>();
        HashMap<Integer, Integer> mp = new HashMap<Integer, Integer>();
        int[] ans = new int[n];
        Arrays.fill(ans, -1);
        HashSet<Integer> used = new HashSet<Integer>();
        int[] mas = new int[n];

        for (int i = 0; i < n; i++) {
            int t = nextInt();
            al.add(t);
            mas[i] = t;
            mp.put(t, i);
        }

        for (int st : al) {
            if (used.contains(st))
                continue;

            {
                int pr = st;
                int cc = -1;
                HashSet<Integer> u2 = new HashSet<Integer>();
                u2.add(pr);
                if (!u2.contains(a - pr) && al.contains(a - pr))
                    cc = a - pr;
                if (!u2.contains(a - pr) && al.contains(b - pr))
                    cc = b - pr;
                if (cc != -1) {
                    u2.add(cc);
                    boolean bGo = true;
                    while (bGo) {
                        bGo = false;
                        int nxt = -1;
                        if (!u2.contains(a - cc) && al.contains(a - cc))
                            nxt = a - cc;
                        if (!u2.contains(b - cc) && al.contains(b - cc))
                            nxt = b - cc;
                        if (nxt != -1) {
                            bGo = true;
                            u2.add(nxt);
                            cc = nxt;
                            pr = cc;
                        }
                    }
                    st = cc;
                }
            }

            LinkedList<Integer> ll = new LinkedList<Integer>();
            ll.add(st);
            while (!ll.isEmpty()) {
                int curr = ll.pollFirst();
                used.add(curr);
                int next1 = a - curr;
                if (al.contains(next1)) {
                    if (!used.contains(next1)) {
                        ll.addLast(next1);
                        if (ans[mp.get(curr)] == -1 && ans[mp.get(next1)] == -1) {
                            ans[mp.get(next1)] = 0;
                            ans[mp.get(curr)] = 0;
                        }
                    }
                }
                int next2 = b - curr;
                if (al.contains(next2)) {
                    if (!used.contains(next2)) {
                        ll.addLast(next2);
                        if (ans[mp.get(curr)] == -1 && ans[mp.get(next2)] == -1) {
                            ans[mp.get(next2)] = 1;
                            ans[mp.get(curr)] = 1;
                        }
                    }
                }
            }
        }

        for (int i = 0; i < n; i++) {
            if (ans[i] == -1) {
                if (2 * mas[i] == a) {
                    ans[i] = 0;
                    continue;
                }
                if (2 * mas[i] == b) {
                    ans[i] = 1;
                    continue;
                }
                writer.println("NO");
                return;
            }
        }

        writer.println("YES");
        for (int i = 0; i < n; i++) {
            writer.print(ans[i] + " ");
        }
    }
    }


import java.util.*;
import java.io.*;
public class b {
public static void main(String[] args) throws IOException
{
    input.init(System.in);
    PrintWriter out = new PrintWriter(System.out);
    int n = input.nextInt(), a = input.nextInt(), b = input.nextInt();
    Num[] data = new Num[n];
    for(int i = 0; i<n; i++) data[i] = new Num(input.nextInt(), i);
    int[] res = new int[n];
    Arrays.fill(res,-1);
    Arrays.sort(data);
    HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
    for(int i = 0; i<n; i++)
        map.put(data[i].x, data[i].i);
    boolean good = true;
    for(int i = 0; i<n; i++)
    {
        if(res[data[i].i] != -1) continue;
        int val = data[i].x;
        if(!map.containsKey(a-val) && !map.containsKey(b-val))
        {
            good = false;
            break;
        }
        if(!map.containsKey(a-val))
        {
            int other = map.get(b-val);
            if(res[other] == 0)
            {
                good = false;
                break;
            }
            res[other] = res[data[i].i] = 1;
        }
        else if(!map.containsKey(b-val))
        {
            int other = map.get(a-val);
            if(res[other] == 1)
            {
                good = false;
                break;
            }
            res[other] = res[data[i].i] = 0;
        }
        else
        {
            int cur = data[i].i;
            int otherB = map.get(b-val), otherA = map.get(a-val);
            if(b > a && res[otherB] != 0)
            {
                res[cur] = res[otherB] = 1;
            }
            else if(a>b && res[otherA] != 1)
            {
                res[cur] = res[otherA] = 0;
            }
            else if(b > a && res[otherA] != 1)
            {
                res[cur] = res[otherA] = 0;
            }
            else if(a > b && res[otherB] != 0)
            {
                res[cur] = res[otherB] = 1;
            }
            else if(b == a)
            {
                res[cur] = res[otherA] = 0;
            }
            else
            {
                good = false;
                break;
            }
        }
    }
    if(good)
    {
        out.println("YES");
        for(int x: res) out.print(x+" ");
    }
    else
        out.println("NO");

    out.close();
}
static class Num implements Comparable<Num>
{
    int x, i;
    public Num(int xx, int ii)
    {
        x = xx; i = ii;
    }
    @Override
    public int compareTo(Num o) {
        // TODO Auto-generated method stub
        return x - o.x;
    }
}
public static class input {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }
}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {

    private PrintWriter out;
    private Map<Integer, Integer> map;

    private int arr[], ans[];
    int n, a, b;

    class DSU {
        private int[] p, size;

        public DSU(int n) {
            p = new int[n];
            size = new int[n];

            for (int i=0; i<n; i++) {
                p[i] = i;
                size[i] = 1;
            }
        }

        public int find(int i) {
            if (p[i] == i) {
                return i;
            }
            return p[i] = find(p[i]);
        }

        public void union (int a, int b) {
            a = find(a); b = find(b);
            if (size[a] > size[b]) {
                p[b] = a;
                size[a] += size[b];
            } else {
                p[a] = b;
                size[b] += size[a];
            }
        }
    }

    private void solve() throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(new OutputStreamWriter(System.out));

        StringTokenizer st = new StringTokenizer(in.readLine());

        n = Integer.valueOf(st.nextToken());
        a = Integer.valueOf(st.nextToken());
        b = Integer.valueOf(st.nextToken());
        map = new HashMap<Integer, Integer>(n);

        String line = in.readLine();
        StringTokenizer st1 = new StringTokenizer(line);

        arr = new int[n];
        ans = new int[n];
        DSU dsu = new DSU(n);

        for (int i=0; i<n; i++) {
            arr[i] = Integer.valueOf(st1.nextToken());
            map.put(arr[i], i);
        }
        in.close();

        for (int i=0; i<n; i++) {
            boolean f = false;
            if (map.get(a - arr[i]) != null) {
                f = true;
                dsu.union(i, map.get(a - arr[i]));
            }

            if (map.get(b - arr[i]) != null) {
                f = true;
                dsu.union(i, map.get(b - arr[i]));
            }

            if (!f) {
                out.println("NO");
                out.flush();
                return;
            }
        }

        for (int i=0; i<n; i++) {
            int p = dsu.find(i);
            if (map.get(a - arr[i]) == null) {
                ans[p] = 1;
            } else if (map.get(b - arr[i]) == null) {
                ans[p] = 0;
            }
        }

        for (int i=0; i<n; i++) {
            int p = dsu.find(i);
            if (ans[p] == 0 && map.get(a - arr[i]) == null) {
                out.println("NO");
                out.flush();
                return;
            }

            if (ans[p] == 1 && map.get(b - arr[i]) == null) {
                out.println("NO");
                out.flush();
                return;
            }
        }

        out.println("YES");
        for (int i=0; i<n; i++) {
            out.print(ans[dsu.find(i)] + " ");
        }

        out.flush();
        out.close();
    }

    public static void main(String[] args) throws Exception {
        new Main().solve();
    }
}


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

public class Pr468B {
	public static void main(String[] args) throws IOException {
		new Pr468B().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out, true);
		solve();
		out.flush();
	}

	int[] which;
	boolean[] was;
	int[] pa;
	int[] pb;

	void dfs(int i, boolean fa) {
		was[i] = true;
		if (fa) {
			if (pa[i] == -1) {
				out.println("NO");
				out.flush();
				System.exit(0);
			}
			which[i] = 0;
			which[pa[i]] = 0;
			if (pb[pa[i]] != -1 && !was[pb[pa[i]]]) {
				dfs(pb[pa[i]], fa);
			}
		} else {
			if (pb[i] == -1) {
				out.println("NO");
				out.flush();
				System.exit(0);
			}
			which[i] = 1;
			which[pb[i]] = 1;
			if (pa[pb[i]] != -1 && !was[pa[pb[i]]]) {
				dfs(pa[pb[i]], fa);
			}
		}
	}

	void solve() throws IOException {
		int n = nextInt();
		int a = nextInt();
		int b = nextInt();
		int[] p = new int[n];
		HashMap<Integer, Integer> allNums = new HashMap<Integer, Integer>();
		for (int i = 0; i < n; i++) {
			p[i] = nextInt();
			if (p[i] >= Math.max(a, b)) {
				out.println("NO");
				return;
			}
			allNums.put(p[i], i);
		}
		pa = new int[n];
		pb = new int[n];
		Arrays.fill(pa, -1);
		Arrays.fill(pb, -1);
		which = new int[n];
		Arrays.fill(which, -1);
		for (int i = 0; i < n; i++) {
			if (pa[i] == -1 && allNums.containsKey(a - p[i])) {
				pa[i] = allNums.get(a - p[i]);
				pa[pa[i]] = i;
			}
			if (pb[i] == -1 && allNums.containsKey(b - p[i])) {
				pb[i] = allNums.get(b - p[i]);
				pb[pb[i]] = i;
			}
			if (pa[i] == -1 && pb[i] == -1) {
				out.println("NO");
				return;
			}
		}
		was = new boolean[n];
		for (int i = 0; i < n; i++) {
			if (!was[i] && pa[i] == -1) {
				dfs(i, false);
			} else if (!was[i] && pb[i] == -1) {
				dfs(i, true);
			}
		}
		for (int i = 0; i < n; i++) {
			if (!was[i]) {
				dfs(i, true);
			}
		}
		out.println("YES");
		for (int i = 0; i < n; i++) {
			out.print(which[i] + " ");
		}
	}
}


import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) {

		Scanner in = new Scanner(new BufferedInputStream(System.in));
		PrintWriter out = new PrintWriter(new BufferedWriter(
				new OutputStreamWriter(System.out)));

		while (in.hasNext()) {
			int n = in.nextInt(), a = in.nextInt(), b = in.nextInt(), c = 0;
			int[] p = new int[n];

			TreeMap<Integer, Integer> map = new TreeMap<Integer, Integer>();
			for (int i = 0; i < n; i++) {
				p[i] = in.nextInt();
				map.put(p[i], i);
			}

			if (a > b) {
				int t = b;
				b = a;
				a = t;
				c = 1;
			}

			boolean ok = true;
			int[] cls = new int[n];
			while (ok && map.size() > 0) {
				Entry<Integer, Integer> last = map.lastEntry();
				int v = last.getKey();
				int idx = last.getValue();
				if (map.containsKey(a - v)) {
					cls[idx] = 0;
					cls[map.get(a - v)] = 0;
					map.remove(v);
					map.remove(a -v);
				} else if (map.containsKey(b - v)) {
					cls[idx] = 1;
					cls[map.get(b - v)] = 1;
					map.remove(v);
					map.remove(b -v);
				} else
					ok = false;
			}

			if (!ok)
				System.out.println("NO");
			else {
				System.out.println("YES");
				for (int j = 0; j < cls.length; j++) {
					if (j != 0)
						System.out.print(" ");
					System.out.print(c ^ cls[j]);
				}
				System.out.println();
			}
			out.flush();
		}
		in.close();
	}

}


import java.util.*;
import java.io.*;
import java.awt.Point;
import java.math.BigDecimal;
import java.math.BigInteger;

import static java.lang.Math.*;

// Solution is at the bottom of code

public class B implements Runnable{

	final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

	BufferedReader in;
	OutputWriter out;
	StringTokenizer tok = new StringTokenizer("");

	public static void main(String[] args){
		new Thread(null, new B(), "", 128 * (1L << 20)).start();
	}

	/////////////////////////////////////////////////////////////////////

	void init() throws FileNotFoundException{
		Locale.setDefault(Locale.US);

		if (ONLINE_JUDGE){
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new OutputWriter(System.out);
		}else{
			in = new BufferedReader(new FileReader("input.txt"));
			out = new OutputWriter("output.txt");
		}
	}

	////////////////////////////////////////////////////////////////

	long timeBegin, timeEnd;

	void time(){
		timeEnd = System.currentTimeMillis();
		System.err.println("Time = " + (timeEnd - timeBegin));
	}

	void debug(Object... objects){
		if (ONLINE_JUDGE){
			for (Object o: objects){
				System.err.println(o.toString());
			}
		}
	}

	/////////////////////////////////////////////////////////////////////

	public void run(){
		try{
			timeBegin = System.currentTimeMillis();
			Locale.setDefault(Locale.US);

			init();
			solve();

			out.close();
			time();
		}catch (Exception e){
			e.printStackTrace(System.err);
			System.exit(-1);
		}
	}

	/////////////////////////////////////////////////////////////////////

	String delim = " ";

	String readString() throws IOException{
		while(!tok.hasMoreTokens()){
			try{
				tok = new StringTokenizer(in.readLine());
			}catch (Exception e){
				return null;
			}
		}

		return tok.nextToken(delim);
	}

	String readLine() throws IOException{
		return in.readLine();
	}

	/////////////////////////////////////////////////////////////////

	final char NOT_A_SYMBOL = '\0';

	char readChar() throws IOException{
		int intValue = in.read();

		if (intValue == -1){
			return NOT_A_SYMBOL;
		}

		return (char) intValue;
	}

	char[] readCharArray() throws IOException{
		return readLine().toCharArray();
	}

	/////////////////////////////////////////////////////////////////

	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}

	int[] readIntArray(int size) throws IOException {
		int[] array = new int[size];

		for (int index = 0; index < size; ++index){
			try {
				array[index] = readInt();
			} catch (Exception e) {
				System.err.println(index);
				return null;
			}
		}

		return array;
	}

	int[] readSortedIntArray(int size) throws IOException {
		Integer[] array = new Integer[size];

		for (int index = 0; index < size; ++index) {
			array[index] = readInt();
		}
		Arrays.sort(array);

		int[] sortedArray = new int[size];
		for (int index = 0; index < size; ++index) {
			sortedArray[index] = array[index];
		}

		return sortedArray;
	}

	int[] readIntArrayWithDecrease(int size) throws IOException {
		int[] array = readIntArray(size);

		for (int i = 0; i < size; ++i) {
			array[i]--;
		}

		return array;
	}

	///////////////////////////////////////////////////////////////////

	int[][] readIntMatrix(int rowsCount, int columnsCount) throws IOException {
		int[][] matrix = new int[rowsCount][];

		for (int rowIndex = 0; rowIndex < rowsCount; ++rowIndex) {
			matrix[rowIndex] = readIntArray(columnsCount);
		}

		return matrix;
	}

	int[][] readIntMatrixWithDecrease(int rowsCount, int columnsCount) throws IOException {
		int[][] matrix = new int[rowsCount][];

		for (int rowIndex = 0; rowIndex < rowsCount; ++rowIndex) {
			matrix[rowIndex] = readIntArrayWithDecrease(columnsCount);
		}

		return matrix;
	}

	///////////////////////////////////////////////////////////////////

	long readLong() throws IOException{
		return Long.parseLong(readString());
	}

	long[] readLongArray(int size) throws IOException{
		long[] array = new long[size];

		for (int index = 0; index < size; ++index){
			array[index] = readLong();
		}

		return array;
	}

	////////////////////////////////////////////////////////////////////

	double readDouble() throws IOException{
		return Double.parseDouble(readString());
	}

	double[] readDoubleArray(int size) throws IOException{
		double[] array = new double[size];

		for (int index = 0; index < size; ++index){
			array[index] = readDouble();
		}

		return array;
	}

	////////////////////////////////////////////////////////////////////

	BigInteger readBigInteger() throws IOException {
		return new BigInteger(readString());
	}

	BigDecimal readBigDecimal() throws IOException {
		return new BigDecimal(readString());
	}

	/////////////////////////////////////////////////////////////////////

	Point readPoint() throws IOException{
		int x = readInt();
		int y = readInt();
		return new Point(x, y);
	}

	Point[] readPointArray(int size) throws IOException{
		Point[] array = new Point[size];

		for (int index = 0; index < size; ++index){
			array[index] = readPoint();
		}

		return array;
	}

	/////////////////////////////////////////////////////////////////////

	List<Integer>[] readGraph(int vertexNumber, int edgeNumber)
	throws IOException{
		@SuppressWarnings("unchecked")
		List<Integer>[] graph = new List[vertexNumber];

		for (int index = 0; index < vertexNumber; ++index){
			graph[index] = new ArrayList<Integer>();
		}

		while (edgeNumber-- > 0){
			int from = readInt() - 1;
			int to = readInt() - 1;

			graph[from].add(to);
			graph[to].add(from);
		}

		return graph;
	}

	/////////////////////////////////////////////////////////////////////

	static class IntIndexPair {

		static Comparator<IntIndexPair> increaseComparator = new Comparator<B.IntIndexPair>() {

			@Override
			public int compare(IntIndexPair indexPair1, IntIndexPair indexPair2) {
				int value1 = indexPair1.value;
				int value2 = indexPair2.value;

				if (value1 != value2) return value1 - value2;

				int index1 = indexPair1.index;
				int index2 = indexPair2.index;

				return index1 - index2;
			}
		};

		static Comparator<IntIndexPair> decreaseComparator = new Comparator<B.IntIndexPair>() {

			@Override
			public int compare(IntIndexPair indexPair1, IntIndexPair indexPair2) {
				int value1 = indexPair1.value;
				int value2 = indexPair2.value;

				if (value1 != value2) return -(value1 - value2);

				int index1 = indexPair1.index;
				int index2 = indexPair2.index;

				return index1 - index2;
			}
		};

		int value, index;

		public IntIndexPair(int value, int index) {
			super();
			this.value = value;
			this.index = index;
		}

		public int getRealIndex() {
			return index + 1;
		}
	}

	IntIndexPair[] readIntIndexArray(int size) throws IOException {
		IntIndexPair[] array = new IntIndexPair[size];

		for (int index = 0; index < size; ++index) {
			array[index] = new IntIndexPair(readInt(), index);
		}

		return array;
	}

	/////////////////////////////////////////////////////////////////////

	static class OutputWriter extends PrintWriter {

		final int DEFAULT_PRECISION = 12;

		protected int precision;
		protected String format, formatWithSpace;

		{
			precision = DEFAULT_PRECISION;

			format = createFormat(precision);
			formatWithSpace = format + " ";
		}

		public OutputWriter(OutputStream out) {
			super(out);
		}

		public OutputWriter(String fileName) throws FileNotFoundException {
			super(fileName);
		}

		public int getPrecision() {
			return precision;
		}

		public void setPrecision(int precision) {
			precision = max(0, precision);
			this.precision = precision;

			format = createFormat(precision);
			formatWithSpace = format + " ";
		}

		private String createFormat(int precision){
			return "%." + precision + "f";
		}

		@Override
		public void print(double d){
			printf(format, d);
		}

		public void printWithSpace(double d){
			printf(formatWithSpace, d);
		}

		public void printAll(double...d){
			for (int i = 0; i < d.length - 1; ++i){
				printWithSpace(d[i]);
			}

			print(d[d.length - 1]);
		}

		@Override
		public void println(double d){
			printlnAll(d);
		}

		public void printlnAll(double... d){
			printAll(d);
			println();
		}
	}

	/////////////////////////////////////////////////////////////////////

	static final int[][] steps = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
	static final int[][] steps8 = {
			{-1, 0}, {1, 0}, {0, -1}, {0, 1},
			{-1, -1}, {1, 1}, {1, -1}, {-1, 1}
	};

	static final boolean check(int index, int lim){
		return (0 <= index && index < lim);
	}

	/////////////////////////////////////////////////////////////////////

	static final boolean checkBit(int mask, int bit){
		return (mask & (1 << bit)) != 0;
	}

	/////////////////////////////////////////////////////////////////////

	static final long getSum(int[] array) {
		long sum = 0;
		for (int value: array) {
			sum += value;
		}

		return sum;
	}

	static final Point getMinMax(int[] array) {
		int min = array[0];
		int max = array[0];

		for (int index = 0, size = array.length; index < size; ++index, ++index) {
			int value = array[index];

			if (index == size - 1) {
				min = min(min, value);
				max = max(max, value);
			} else {
				int otherValue = array[index + 1];

				if (value <= otherValue) {
					min = min(min, value);
					max = max(max, otherValue);
				} else {
					min = min(min, otherValue);
					max = max(max, value);
				}
			}
		}

		return new Point(min, max);
	}

	/////////////////////////////////////////////////////////////////////

	void solve() throws IOException {
		int n = readInt();

		int a = readInt();
		int b = readInt();

		Map<Integer, Integer> numbers = new HashMap<>();
		int[] p = readIntArray(n);
		for (int index = 0; index < n; ++index) {
			numbers.put(p[index], index);
		}

		Set<Integer> used = new HashSet<Integer>();
		Deque<Integer> q = new ArrayDeque<Integer>();

		int[] answers = new int[n];
		for (int i = 0; i < n; ++i) {
			if (used.contains(p[i])) continue;

			int leftSize = 0;
			for (int number = p[i], cur = a, next = b;
					numbers.containsKey(number) && !used.contains(number);
					number = cur - number, cur = (a ^ b ^ cur), next = (a ^ b ^ next)) {
				q.addFirst(number);
				used.add(number);

				++leftSize;
			}

			for (int number = b - p[i], cur = a, next = b;
					numbers.containsKey(number) && !used.contains(number);
					number = cur - number, cur = (a ^ b ^ cur), next = (a ^ b ^ next)) {
				q.addLast(number);
				used.add(number);
			}

			int curColor = (leftSize & 1);
			if ((q.size() & 1) == 1) {
				int first = q.peekFirst();

				// 0 - a, 1 - b
				if (curColor == 0 && (first << 1) == b
						||
					curColor == 1 && (first << 1) == a) {
					q.poll();

					curColor ^= 1;

					int firstIndex = numbers.get(first);
					answers[firstIndex] = curColor;
				} else {
					int last = q.peekLast();

					// 0 - b, 1 - a
					if (curColor == 0 && (last << 1) == a
							||
						curColor == 1 && (first << 1) == b) {
						q.poll();

						int firstIndex = numbers.get(first);
						answers[firstIndex] = curColor;
					} else {
						out.println("NO");
						return;
					}
				}
			}

			while (q.size() > 0) {
				int first = q.poll();
				int second = q.poll();

				int firstIndex = numbers.get(first);
				int secondIndex = numbers.get(second);

				answers[firstIndex] = curColor;
				answers[secondIndex] = curColor;
			}
		}

		out.println("YES");
		for (int answer : answers) {
			out.print(answer + " ");
		}
		out.println();
	}
}


import java.util.List;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

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

class TaskB {
    /////////////////////////////////////////////////////////////
    static nn[] B;
    static int n,a,b;
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
     n=in.nextInt();a=in.nextInt();b=in.nextInt();
        int ccc=0;
        if (a==b)ccc=1;
     int[] A=in.readIntArray(n);
      B=new nn[n];
        for (int i = 0; i < n; i++) {
            B[i]=new nn(A[i],i);
        }
        ArrayUtils.shuffle(B);
        Arrays.sort(B);
        int chk=1;
        for (int i = 0; i < n; i++) {
            if (B[i].assign>=0)continue;
            int v=B[i].val;
            int cc=0;
            int pos1=Arrays.binarySearch(B,new nn(a-v,0));
            if (pos1>=0&&B[pos1].assign==-1)cc++;
           if (a!=b){
            int pos2=Arrays.binarySearch(B,new nn(b-v,0));
            if (pos2>=0&&B[pos2].assign==-1)cc++; }
            if (cc==0){
                chk=0;
                break;
            }
            if (cc==1){
            go(i);
            }
        }
        if (chk==0){
            out.println("NO");
            return;
        }
        int[] ans= new int[n];
        for (int i = 0; i < n; i++) {
            ans[B[i].pos]=B[i].assign;
        }
        out.println("YES");
        for (int i = 0; i < n; i++) {
          out.print(ans[i] + " ");
        }
        out.println();
        }
    static void go (int i){
        int v=B[i].val;
        int pos1=Arrays.binarySearch(B,new nn(a-v,0));
        if (pos1>=0&&B[pos1].assign==-1){
           B[i].assign=0;
           B[pos1].assign=0;
           int vv=B[pos1].val;
           int np=Arrays.binarySearch(B,new nn(b-vv,0));
           if (np>=0)go(np);

        }
        if (a!=b){
        int pos2=Arrays.binarySearch(B,new nn(b-v,0));
        if (pos2>=0&&B[pos2].assign==-1){
            B[i].assign=1;
            B[pos2].assign=1;
            int vv=B[pos2].val;
            int np=Arrays.binarySearch(B,new nn(a-vv,0));
            if (np>=0)go(np);
        } }

    }

}

class nn implements Comparable<nn> {
        int val,pos;

        public String toString() {
            return "nn{" +
                    "val=" + val +
                    ", pos=" + pos +
                    ", assign=" + assign +
                    ", ct=" + ct +
                    '}';
        }

        int assign=-1;
        int ct=0;
        nn(int val, int pos) {
            this.val = val;
            this.pos = pos;
        }

        public int compareTo(nn o) {
            return this.val-o.val;  //To change body of implemented methods use File | Settings | File Templates.
        }

}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

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

    public int[] readIntArray(int n) {
        int[] ret = new int[n];
        for (int i = 0; i < n; i++) {
            ret[i] = nextInt();
        }
        return ret;
    }

}

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}

class ArrayUtils {

    static final long seed = System.nanoTime();

    static final Random rand = new Random(seed);

    public static <T> void shuffle(T[] a) {
        for (int i = 0; i < a.length; i++) {
            int j = rand.nextInt(i + 1);
            T t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

}


import java.util.Map;
import java.io.IOException;
import java.util.TreeMap;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.OutputStream;
import java.util.ArrayDeque;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Queue;
import java.util.Collection;
import java.io.InputStream;

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

class TaskB
{
    int val[];
    int p[];
    int aneigh[], bneight[], deg[];
    public void solve(int testNumber, FastReader in, PrintWriter out)
    {
        int n = in.ni ();
        val = new int[n];
        int a = in.ni ();
        int b = in.ni ();
        Map<Integer, Integer> set = new TreeMap<Integer, Integer> ();
        p = in.iArr (n);
        for (int i = 0; i < n; i++)
        {
            set.put (p[i], i);
        }
        aneigh = new int[n];
        bneight = new int[n];
        deg = new int[n];
        for (int i = 0; i < n; i++)
        {
            aneigh[i] = val[i] = bneight[i] = -1;
            deg[i] = 0;
        }
        Queue<Integer> queue = new ArrayDeque<Integer> ();
        for (int i = 0; i < n; i++)
        {
            Integer x1 = set.get (a - p[i]);
            Integer x2 = set.get (b - p[i]);
            if (x1 != null)
            {
                aneigh[i] = x1;
                deg[i]++;
            }
            if (x2 != null && a != b)
            {
                bneight[i] = x2;
                deg[i]++;
            }
            if (deg[i] == 1)
            {
                queue.add (i);
            }
        }

        while (!queue.isEmpty ())
        {
            int idx = queue.remove ();
            if (deg[idx] != 1)
            {
                continue;
            }
            int aa = aneigh[idx];
            int bb = bneight[idx];
            if (aa != -1)
            {
                val[idx] = val[aa] = 0;
                deg[aa]--;
                deg[idx]--;
                aneigh[aa] = -1;
                aneigh[idx] = -1;
                if (deg[aa] == 1)
                {
                    int zz = bneight[aa];
                    bneight[zz] = -1;
                    deg[zz]--;
                    if(deg[zz] == 1)
                    queue.add (zz);
                }
            }
            else
            {
                val[idx] = val[bb] = 1;
                deg[bb]--;
                deg[idx]--;
                bneight[idx] = bneight[bb] = -1;
                if (deg[bb] == 1)
                {
                    //queue.add (bb);
                    int zz = aneigh[bb];
                    aneigh[zz] = -1;
                    deg[zz]--;
                    if(deg[zz] == 1)
                        queue.add (zz);
                }
            }
        }

        for (int i = 0; i < n; i++)
        {
            if (val[i] == -1 && cantBePaired(i))
            {
                out.println ("NO");
                return;
            }
        }
        //every person has two neighbours

        out.println ("YES");
        for (int i = 0; i < n; i++)
        {
            out.print (val[i] + " ");
        }
        out.println ();
    }

    private boolean cantBePaired(int i)
    {
        int aa = aneigh[i];
        int bb = bneight[i];
        if (aa != -1 && val[aa] == -1)
        {
            return false;
        }
        if (bb != -1 && val[bb] == -1)
        {
            return false;
        }
        return true;
    }
}

class FastReader
{

    public InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

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

    public FastReader()
    {

    }

    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 ni()
    {
        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 int[] iArr(int n)
    {
        int a[] = new int[n];
        for (int i = 0; i < n; i++)
        {
            a[i] = ni ();
        }
        return a;
    }

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


import java.util.ArrayList;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.io.BufferedReader;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author shu_mj @ http://shu-mj.com
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    Scanner in;
    PrintWriter out;

    public void solve(int testNumber, Scanner in, PrintWriter out) {
        this.in = in;
        this.out = out;
        run();
    }

    void run() {
        int n = in.nextInt();
        int a = in.nextInt();
        int b = in.nextInt();
        int[] is = in.nextIntArray(n);
        Map<Integer, Integer> id = new HashMap<Integer, Integer>();
        for (int i = 0; i < n; i++) {
            id.put(is[i], i);
        }
        SCC.V[] vs = new SCC.V[n * 2];
        for (int i = 0; i < vs.length; i++) vs[i] = new SCC.V();
        for (int i = 0; i < n; i++) {
            if (id.containsKey(a - is[i])) {
                int j = id.get(a - is[i]);
                vs[i].add(vs[j]);
                vs[j + n].add(vs[i + n]);
            } else {
                vs[i].add(vs[i + n]);
            }
            if (id.containsKey(b - is[i])) {
                int j = id.get(b - is[i]);
                vs[i + n].add(vs[j + n]);
                vs[j].add(vs[i]);
            } else {
                vs[i + n].add(vs[i]);
            }
        }
        SCC.scc(vs);
        for (int i = 0; i < n; i++) {
            if (vs[i].comp == vs[i + n].comp) {
                out.println("NO");
                return ;
            }
        }
        out.println("YES");
        for (int i = 0; i < n; i++) {
            if (vs[i].comp > vs[i + n].comp) {
                out.print("0 ");
            } else {
                out.print("1 ");
            }
        }
        out.println();
    }
}

class Scanner {
    BufferedReader br;
    StringTokenizer st;

    public Scanner(InputStream in) {
        br = new BufferedReader(new InputStreamReader(in));
        eat("");
    }

    private void eat(String s) {
        st = new StringTokenizer(s);
    }

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

    public boolean hasNext() {
        while (!st.hasMoreTokens()) {
            String s = nextLine();
            if (s == null)
                return false;
            eat(s);
        }
        return true;
    }

    public String next() {
        hasNext();
        return st.nextToken();
    }

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

    public int[] nextIntArray(int n) {
        int[] is = new int[n];
        for (int i = 0; i < n; i++) {
            is[i] = nextInt();
        }
        return is;
    }

}

class SCC {

    public static int n;
    public static V[] us;

    public static int scc(V[] vs) {
        n = vs.length;
        us = new V[n];
        for (V v : vs) if (!v.visit) dfs(v);
        for (V v : vs) v.visit = false;
        for (V u : us) if (!u.visit) dfsRev(u, n++);
        return n;
    }

    public static void dfs(V v) {
        v.visit = true;
        for (V u : v.fs) if (!u.visit) dfs(u);
        us[--n] = v;
    }

    public static void dfsRev(V v, int k) {
        v.visit = true;
        for (V u : v.rs) if (!u.visit) dfsRev(u, k);
        v.comp = k;
    }

    public static class V {
        public boolean visit;
        public int comp;
        public List<V> fs = new ArrayList<V>();
        public List<V> rs = new ArrayList<V>();

        public void add(V u) {
            fs.add(u);
            u.rs.add(this);
        }
    }
}