Codeforces Round 268 (Div. 1) |
---|

Finished |

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

2-sat

dfs and similar

dsu

graph matchings

greedy

*2000

No tag edit access

The problem statement has recently been changed. View the changes.

×
B. Two Sets

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputLittle X has *n* distinct integers: *p*_{1}, *p*_{2}, ..., *p*_{n}. 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* ≤ 10^{5}; 1 ≤ *a*, *b* ≤ 10^{9}). The next line contains *n* space-separated distinct integers *p*_{1}, *p*_{2}, ..., *p*_{n} (1 ≤ *p*_{i} ≤ 10^{9}).

Output

If there is a way to divide the numbers into two sets, then print "YES" in the first line. Then print *n* integers: *b*_{1}, *b*_{2}, ..., *b*_{n} (*b*_{i} equals either 0, or 1), describing the division. If *b*_{i} equals to 0, then *p*_{i} 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.

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Apr/14/2024 21:09:31 (l3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|