#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long double PI = (long double)(3.1415926535897932384626433832795);
inline bool ispow2(int x) { return (x != 0 && (x & (x - 1)) == 0); }
template <class T>
inline void cinarr(T a, int n) {
  for (int i = 0; i < n; ++i) cin >> a[i];
}
inline long long powmod(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
inline long long gcd(long long a, long long b) {
  long long t;
  while (b) {
    a = a % b;
    t = a;
    a = b;
    b = t;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
const int msz = 1e6 + 7;
int parent[msz];
int root(int x) {
  if (parent[x] != x) parent[x] = root(parent[x]);
  return parent[x];
}
void connect(int x, int y) {
  int rx = root(x);
  int ry = root(y);
  if (rx != ry) parent[rx] = ry;
}
map<int, int> pre;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  long long a, b;
  cin >> n >> a >> b;
  int ar[n];
  for (int i = 1; i <= n; i++) {
    cin >> ar[i], pre[ar[i]] = i, parent[i] = i;
  }
  parent[n + 1] = n + 1;
  parent[n + 2] = n + 2;
  for (int i = 1; i <= n; i++) {
    if (pre[a - ar[i]])
      connect(pre[ar[i]], pre[a - ar[i]]);
    else
      connect(pre[ar[i]], n + 2);
    if (pre[b - ar[i]])
      connect(pre[ar[i]], pre[b - ar[i]]);
    else
      connect(pre[ar[i]], n + 1);
  }
  if (root(n + 1) == root(n + 2))
    cout << "NO"
         << "\n";
  else {
    cout << "YES"
         << "\n";
    for (int i = 1; i <= n; i++) {
      cout << (root(i) == root(n + 2)) << " ";
    }
  }
  return 0;
}
