#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int N = 200001;
const int M = 1500000;
const int inf = INT_MAX / 3;
int head[N];
struct node {
  int to, next;
} g[M];
int m, n, p, num;
int matchx[N], matchy[N], que[N], dis[N];
void addEdge(int s, int e) {
  g[num].to = e;
  g[num].next = head[s];
  head[s] = num++;
}
bool bfs() {
  int i, j;
  int front, rear;
  front = rear = 0;
  for (i = 1; i <= n; i++) {
    if (!matchx[i]) {
      dis[i] = 0;
      que[rear++] = i;
    } else
      dis[i] = inf;
  }
  dis[0] = inf;
  while (front != rear) {
    int u = que[front++];
    if (front == N) front = 0;
    for (i = head[u]; ~i; i = g[i].next) {
      int v = g[i].to;
      if (dis[matchy[v]] == inf) {
        dis[matchy[v]] = dis[u] + 1;
        que[rear++] = matchy[v];
        if (rear == N) rear = 0;
      }
    }
  }
  return dis[0] != inf;
}
bool dfs(int u) {
  int v;
  for (int i = head[u]; ~i; i = g[i].next) {
    v = g[i].to;
    if (dis[matchy[v]] == dis[u] + 1)
      if (matchy[v] == 0 || dfs(matchy[v])) {
        matchx[u] = v;
        matchy[v] = u;
        return true;
      }
  }
  dis[u] = inf;
  return false;
}
int arr[N];
int a, b;
void Hopcroft_Karp() {
  memset(matchx, 0, sizeof(matchx));
  memset(matchy, 0, sizeof(matchy));
  int ans = 0, i;
  while (bfs()) {
    getchar();
    for (i = 1; i <= n; i++)
      if (!matchx[i])
        if (dfs(i)) ans++;
  }
  if (ans != n)
    puts("NO");
  else {
    puts("YES");
    for (i = 1; i <= n; i++) {
      if (arr[i] + arr[matchx[i]] == a)
        printf("0 ");
      else
        printf("1 ");
    }
  }
}
map<int, int> mp;
int find(int ans) {
  int res = mp[ans];
  if (res) return res;
  return -1;
}
int main() {
  scanf("%d%d%d", &n, &a, &b);
  num = 0;
  for (int i = (1); i < (n + 1); i++)
    scanf("%d", &arr[i]), head[i] = -1, mp[arr[i]] = i;
  int A, B, possible = 1;
  for (int i = (1); i < (n + 1); i++) {
    A = find(a - arr[i]);
    B = find(b - arr[i]);
    if (A == -1 && B == -1) {
      possible = false;
      break;
    }
    if (A != -1) addEdge(i, A);
    if (B != -1) addEdge(i, B);
  }
  if (!possible) {
    puts("NO");
  } else {
    Hopcroft_Karp();
  }
  return 0;
}
