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

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



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

Input

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

Output

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

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

Examples

Input

4 5 9
2 3 4 5


Output

YES
0 0 1 1


Input

3 3 4
1 2 4


Output

NO

Note

It's OK if all the numbers are in the same set, and the other one is empty.
import java.util.*;
import java.math.*;
import java.io.*;

public class CF469D {
	static int numTerms;
	static Graph g;
	static SCC s;
	static int[] satisfy;
	public static void main(String[] args) {
		JoltyScanner scan = new JoltyScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		int a = scan.nextInt(), b = scan.nextInt();
		numTerms = n;
		g = new Graph(numTerms * 2);
		int[] arr = new int[n];
		Map<Integer, Integer> map = new HashMap<>();
		for(int i = 0 ; i < n ; i++) {
			arr[i] = scan.nextInt();
			map.put(arr[i], i);
		}
		for(int i = 0 ; i < n ; i++) {
			int x = arr[i];
			if(!map.containsKey(a - x)) {
				force_var(not(i));
			} else {
				add_or(i, not(map.get(a - x)));
				add_or(not(i), map.get(a - x));
			}
			if(!map.containsKey(b - x)) {
				force_var(i);
			} else {
				add_or(i, not(map.get(b - x)));
				add_or(not(i), map.get(b - x));
			}
		}
		s = new SCC(g);
		boolean passed = true;
		for(int i = 0 ; i < numTerms ; i++)
			if(s.scc[i] == s.scc[i + numTerms])
				passed = false;
		if(!passed) {
			out.println("NO");
		} else {
			out.println("YES");
			findSatisfiability();
			for(int i = 0 ; i < numTerms ; i++) {
				if(satisfy[i] == 1)
					out.print(1 + " ");
				else
					out.print(0 + " ");
			}
		}
		out.close();
	}
	
	static void findSatisfiability() {
		List<Integer>[] components = new ArrayList[s.cmp];
		for(int i = 0 ; i < s.cmp ; i++)
			components[i] = new ArrayList<>();
		for(int i = 0 ; i < numTerms * 2 ; i++)
			components[s.scc[i]].add(i);
		List<Integer> terms = new ArrayList<>();
		for(int i = s.cmp - 1 ; i >= 0 ; i--)
			for(int j = 0 ; j < components[i].size() ; j++)
				terms.add(components[i].get(j));
		satisfy = new int[numTerms * 2];
		for(int i = 0 ; i < terms.size() ; i++) {
			int term = terms.get(i);
			if(satisfy[term] == 0) {
				satisfy[term] = 1;
				satisfy[not(term)] = -1;
			}
		}
	}

	static int not(int u) {
		if(u < numTerms)
			return u + numTerms;
		return u - numTerms;
	}

	static void add_imp(int u, int v) {
		g.add(u, v);
	}

	static void add_or(int u, int v) {
		add_imp(not(u), v);
		add_imp(not(v), u);
	}

	static void add_xor(int u, int v) {
		add_or(u, v);
		add_or(not(u), not(v));
	}

	static void force_var(int u) {
		add_imp(not(u), u);
	}


	static class Graph {
		int n;
		List<Integer>[] adj;
		public Graph(int nn) {
			adj = new ArrayList[n = nn];
			for(int i = 0 ; i < n ; i++)
				adj[i] = new ArrayList<>();
		}
		public void add(int u, int v) {
			adj[u].add(v);
		}
	}
	static class SCC {
		Graph g;
		Stack<Integer> stack;
		int[] pre, scc, low;
		int cnt, cmp;

		public SCC(Graph gg) {
			g = gg;
			stack = new Stack<>();
			pre = new int[g.n];
			low = new int[g.n];
			scc = new int[g.n];
			cnt = 0;
			cmp = 0;
			Arrays.fill(pre, -1);

			for(int i = 0 ; i < g.n ; i++) {
				if(pre[i] == -1) {
					dfs(i);
				}
			}
		}

		void dfs(int u) {
			pre[u] = low[u] = cnt++;
			stack.push(u);
			for(int v : g.adj[u]) {
				if(pre[v] == -1)
					dfs(v);
				low[u] = Math.min(low[u], low[v]);
			}
			if(low[u] == pre[u]) {
				while(true) {
					int v = stack.pop();
					scc[v] = cmp;
					low[v] = g.n;
					if(u == v)
						break;
				}
				cmp++;
			}
		}
	}
	static class JoltyScanner {
		public static final int BUFFER_SIZE = 1 << 16;
		public static final char NULL_CHAR = (char) -1;
		byte[] buffer = new byte[BUFFER_SIZE];
		int bufferIdx = 0, size = 0;
		char c = NULL_CHAR;
		BufferedInputStream in;
		public JoltyScanner(InputStream in) {
			this.in = new BufferedInputStream(in, BUFFER_SIZE);
			c = nextChar();
		}
		public int nextInt() {
			while(c < '0' || c > '9')
				c = nextChar();
			int res = 0;
			while(c >= '0' && c <= '9') {
				res = (res << 3) + (res << 1) + c - '0';
				c = nextChar();
			}
			return res;
		}
		public char nextChar() {
			while (bufferIdx == size) {
				try {
					size = in.read(buffer);
				} catch (Exception e) {
					return NULL_CHAR;
				}
				bufferIdx = 0;
			}
			return (char) buffer[bufferIdx++];
		}
	}
}
