#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
vector<int> edge[N * 2];
vector<int> nedge[N * 2];
int data[N], n, a, b;
int dfn[N * 2], low[N * 2], sta[N * 2], instack[N * 2], cnt, idx, top,
    bel[N * 2];
int in[N * 2], color[N * 2], ans[N], opp[N * 2];
map<int, int> h;
void tarjan(int u) {
  int i, v;
  dfn[u] = low[u] = ++idx;
  instack[u] = 1;
  sta[++top] = u;
  for (i = 0; i < (int)edge[u].size(); i++) {
    v = edge[u][i];
    if (!dfn[v]) {
      tarjan(v);
      low[u] = min(low[u], low[v]);
    } else {
      if (instack[v]) low[u] = min(low[u], dfn[v]);
    }
  }
  if (low[u] == dfn[u]) {
    cnt++;
    do {
      v = sta[top--];
      instack[v] = 0;
      bel[v] = cnt;
    } while (u != v);
  }
  return;
}
bool Buildmap() {
  int i;
  for (i = 0; i <= 2 * n; i++) edge[i].clear();
  for (i = 1; i <= n; i++) {
    int posa = h[a - data[i]], posb = h[b - data[i]];
    if (posa == 0 && posb == 0) return false;
    if (posa != 0 && posb == 0) {
      edge[i + n].push_back(i);
      edge[i].push_back(posa);
      edge[posa + n].push_back(i + n);
    }
    if (posa == 0 && posb != 0) {
      edge[i].push_back(i + n);
      edge[i + n].push_back(posb + n);
      edge[posb].push_back(i);
    }
    if (posa != 0 && posb != 0) {
      edge[i].push_back(posa);
      edge[posa + n].push_back(i + n);
      edge[i + n].push_back(posb + n);
      edge[posb].push_back(i);
    }
  }
  memset(dfn, 0, sizeof(dfn));
  memset(low, 0, sizeof(low));
  memset(instack, 0, sizeof(instack));
  memset(bel, 0, sizeof(bel));
  top = idx = cnt = 0;
  for (i = 1; i <= n * 2; i++)
    if (!dfn[i]) tarjan(i);
  for (i = 1; i <= n; i++)
    if (bel[i] == bel[i + n]) return false;
  return true;
}
queue<int> que;
void Dfs(int u) {
  int i, v;
  color[u] = 1;
  color[opp[u]] = -1;
  for (i = 0; i < (int)nedge[u].size(); i++) {
    v = nedge[u][i];
    in[v]--;
    if (!in[v]) que.push(v);
  }
  return;
}
void Buildnemap() {
  int i, v;
  for (i = 0; i <= cnt; i++) nedge[i].clear();
  memset(in, 0, sizeof(in));
  for (i = 1; i <= n; i++) {
    opp[bel[i]] = bel[i + n];
    opp[bel[i + n]] = bel[i];
  }
  for (i = 1; i <= n * 2; i++) {
    for (int j = 0; j < (int)edge[i].size(); j++) {
      v = edge[i][j];
      if (bel[i] != bel[v]) {
        nedge[bel[i]].push_back(bel[v]);
        in[bel[v]]++;
      }
    }
  }
  while (!que.empty()) que.pop();
  for (i = 1; i <= cnt; i++)
    if (!in[i]) que.push(i);
  while (!que.empty()) {
    int now = que.front();
    Dfs(now);
    que.pop();
  }
  memset(ans, 0, sizeof(ans));
  for (i = 1; i <= n; i++)
    if (color[bel[i]] == 1) ans[i] = 1;
  return;
}
int main() {
  int i;
  bool flag = true;
  scanf("%d %d %d", &n, &a, &b);
  for (i = 1; i <= n; i++) {
    scanf("%d", &data[i]);
    h[data[i]] = i;
  }
  flag = Buildmap();
  if (!flag)
    printf("NO");
  else {
    printf("YES\n");
    Buildnemap();
    for (i = 1; i <= n; i++)
      if (i < n)
        printf("%d ", 1 - ans[i]);
      else
        printf("%d", 1 - ans[n]);
  }
  return 0;
}
