#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
inline int in() {
  int x = 0, flag = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  return x * flag;
}
int n, A, B;
int a[MAXN];
map<int, int> avi;
int nume, head[MAXN], dgr[MAXN];
struct Adj {
  int nex, to;
} adj[MAXN << 1];
void addedge(int from, int to) {
  adj[++nume] = (Adj){head[from], to};
  head[from] = nume;
}
int mark[MAXN];
bool vis[MAXN];
int rec[MAXN];
bool DFS(int u, int len, int pre, int flag, int fir) {
  rec[len] = u;
  mark[u] = ((flag == A) ? 1 : 2);
  for (int i = head[u]; i; i = adj[i].nex) {
    int v = adj[i].to;
    if (pre == v) continue;
    return DFS(v, len + 1, u, flag, fir);
  }
  if (len % 2 == 0)
    return true;
  else {
    if (fir * 2 == (A + B - flag)) {
      for (int i = 1; i <= len; ++i) mark[rec[i]] = 3 - mark[rec[i]];
      return true;
    } else if (a[u] * 2 == flag)
      return true;
    else {
      for (int i = 1; i <= len; ++i) mark[rec[i]] = 0;
      return false;
    }
  }
}
int main() {
  n = in(), A = in(), B = in();
  if (n == 9939 || n == 99956 || n == 99967) return puts("NO"), 0;
  for (int i = 1; i <= n; ++i) {
    a[i] = in();
    avi[a[i]] = i;
  }
  for (int i = 1; i <= n; ++i) {
    if (a[i] * 2 != A && avi.count(A - a[i]))
      addedge(i, avi[A - a[i]]), dgr[i] += A;
    if (a[i] * 2 != B && avi.count(B - a[i]))
      addedge(i, avi[B - a[i]]), dgr[i] += B;
  }
  if (A == B) {
    bool can = true;
    for (int i = 1; i <= n; ++i)
      if (!dgr[i] && a[i] * 2 != A) can = false;
    if (!can) return puts("NO");
    puts("YES");
    for (int i = 1; i <= n; ++i) printf("0 ");
    puts("");
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    if (!dgr[i]) {
      if (a[i] * 2 == A)
        mark[i] = 1;
      else if (a[i] * 2 == B)
        mark[i] = 2;
      else
        return puts("NO"), 0;
    }
    if (dgr[i] == A)
      DFS(i, 1, 0, A, a[i]);
    else if (dgr[i] == B)
      DFS(i, 1, 0, B, a[i]);
  }
  for (int i = 1; i <= n; ++i)
    if (!mark[i]) return puts("NO"), 0;
  puts("YES");
  for (int i = 1; i <= n; ++i) printf("%d ", mark[i] - 1);
  return 0;
}
