source_code: import java.util.InputMismatchException;
  import java.math.BigInteger;
  import java.io.*;
  import java.util.*;
  
  /**
   * Generated by Contest helper plug-in
   * Actual solution is at the bottom
   */
  
  public class Main {
  	public static void main(String[] args) {
  		InputReader in = new StreamInputReader(System.in);
  		PrintWriter out = new PrintWriter(System.out);
  		run(in, out);
  	}
  
  	public static void run(InputReader in, PrintWriter out) {
  		Solver solver = new Task();
  		solver.solve(1, in, out);
  		Exit.exit(in, out);
  	}
  }
  
  abstract class InputReader {
  	private boolean finished = false;
  
  	public abstract int read();
  
  	public long readLong() {
  		return new BigInteger(readString()).longValue();
  	}
  
  	public int readInt() {
  		int c = read();
  		while (isSpaceChar(c))
  			c = read();
  		int sgn = 1;
  		if (c == '-') {
  			sgn = -1;
  			c = read();
  		}
  		int res = 0;
  		do {
  			if (c < '0' || c > '9')
  				throw new InputMismatchException();
  			res *= 10;
  			res += c - '0';
  			c = read();
  		} while (!isSpaceChar(c));
  		return res * sgn;
  	}
  
  	public String readString() {
  		int c = read();
  		while (isSpaceChar(c))
  			c = read();
  		StringBuffer res = new StringBuffer();
  		do {
  			res.appendCodePoint(c);
  			c = read();
  		} while (!isSpaceChar(c));
  		return res.toString();
  	}
  
  	private boolean isSpaceChar(int c) {
  		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
  	}
  
  	public void setFinished(boolean finished) {
  		this.finished = finished;
  	}
  
  	public abstract void close();
  }
  
  class StreamInputReader extends InputReader {
  	private InputStream stream;
  	private byte[] buf = new byte[1024];
  	private int curChar, numChars;
  
  	public StreamInputReader(InputStream stream) {
  		this.stream = stream;
  	}
  
  	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 void close() {
  		try {
  			stream.close();
  		} catch (IOException ignored) {
  		}
  	}
  }
  
  class Exit {
  	private Exit() {
  	}
  
  	public static void exit(InputReader in, PrintWriter out) {
  		in.setFinished(true);
  		in.close();
  		out.close();
  	}
  }
  
  interface Solver {
  	public void solve(int testNumber, InputReader in, PrintWriter out);
  }
  
  class Task implements Solver {
  	public void solve(int testNumber, InputReader in, PrintWriter out) {
  		int n = in.readInt();
  		int a = in.readInt();
  		int b = in.readInt();
  		
  		if (a==b) {
  			b = 0;
  		}
  		
  		boolean[] where = new boolean[n];
  		
  		HashSet<Integer> set = new HashSet<Integer>();
  		HashMap<Integer,Integer> indexmap = new HashMap<Integer,Integer>();
  		
  		for (int i = 0; i<n; i++) {
  			int x = in.readInt();
  			indexmap.put(x, i);
  			set.add(x);
  		}
  		
  		while (set.size() > 0) {
  			int size = set.size();
  			HashSet<Integer> todo = new HashSet<Integer>();
  			HashSet<Integer> used = new HashSet<Integer>();
  			for (int x : set) {
  				if (used.contains(x))
  					continue;
  				int ax = a-x;
  				int bx = b-x;
  				
  				if ((set.contains(ax) && !used.contains(ax)) && (set.contains(bx) && !used.contains(bx))) {
  					todo.add(x);
  				} else if (set.contains(ax) && !used.contains(ax)) {
  					used.add(x);
  					used.add(ax);
  					todo.remove(ax);
  					
  					//chain
  					bx = b-ax;
  					while (set.contains(bx) && !used.contains(bx)) {
  						x = bx;
  						ax = a-x;
  						if (!set.contains(ax) || used.contains(ax)) {
  							System.out.println("NO");
  							return;
  						}
  						todo.remove(x);
  						todo.remove(ax);
  						used.add(x);
  						used.add(ax);
  						bx = b-ax;
  					}
  					
  				} else if (set.contains(bx) && !used.contains(bx)) {
  					used.add(x);
  					used.add(bx);
  					todo.remove(bx);
  					where[indexmap.get(bx)] = true;
  					where[indexmap.get(x)] = true;
  					
  					//chain
  					ax = a-bx;
  					while (set.contains(ax) && !used.contains(ax)) {
  						x = ax;
  						bx = b-x;
  						if (!set.contains(bx) || used.contains(bx)) {
  							System.out.println("NO");
  							return;
  						}
  						todo.remove(x);
  						todo.remove(bx);
  						used.add(x);
  						used.add(bx);
  						where[indexmap.get(bx)] = true;
  						where[indexmap.get(x)] = true;
  						ax = a-bx;
  					}
  					
  				} else {
  					System.out.println("NO");
  					return;
  				}
  			}
  			set = todo;
  			if (set.size() == size) {
  				System.out.println("Set size constant!!");
  				break;
  			}
  		}
  		
  		System.out.println("YES");
  		for (int i = 0; i<n; i++)
  			if (where[i])
  				System.out.print("1 ");
  			else
  				System.out.print("0 ");
  	}
  }
  
  class num {
  	
  	
  }
  
  ///
  
  