#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return b < a ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const int MAXN = 200010;
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + (c - '0');
    c = getchar();
  }
  return x * f;
}
int n, a, b, p[MAXN];
map<int, int> mp;
struct Edge {
  int to, next;
} edges[MAXN << 2], edges2[MAXN << 2];
int ex[MAXN << 2], ey[MAXN << 2], deg[MAXN];
int head[MAXN], head2[MAXN], tot, tot2, eot;
void AddEdge(int u, int v) {
  edges[++tot].to = v;
  edges[tot].next = head[u];
  head[u] = tot;
  ex[++eot] = u, ey[eot] = v;
}
void AddEdge2(int u, int v) {
  edges2[++tot2].to = v;
  edges2[++tot2].next = head2[u];
  head2[u] = tot2;
}
int dfn[MAXN], low[MAXN], stk[MAXN], ins[MAXN], c[MAXN];
int num, top, cnt, opp[MAXN], val[MAXN];
queue<int> q;
void tarjan(int x) {
  dfn[x] = low[x] = ++num;
  stk[++top] = x, ins[x] = 1;
  for (int i = head[x]; i; i = edges[i].next) {
    int y = edges[i].to;
    if (!dfn[y]) {
      tarjan(y);
      chkmin(low[x], low[y]);
    } else if (ins[y])
      chkmin(low[x], dfn[y]);
  }
  if (dfn[x] == low[x]) {
    cnt++;
    int y;
    do {
      y = stk[top--], ins[y] = 0;
      c[y] = cnt;
    } while (x != y);
  }
}
void topsort() {
  memset(val, -1, sizeof(val));
  for (int i = (1), i_end_ = (eot); i <= i_end_; ++i)
    if (c[ex[i]] != c[ey[i]]) AddEdge2(c[ey[i]], c[ex[i]]), deg[c[ex[i]]]++;
  for (int i = (1), i_end_ = (cnt); i <= i_end_; ++i)
    if (!deg[i]) q.push(i);
  while (q.size()) {
    int k = q.front();
    q.pop();
    if (val[k] == -1) val[k] = 0, val[opp[k]] = 1;
    for (int i = head2[k]; i; i = edges2[i].next)
      if (--deg[edges2[i].to] == 0) q.push(edges2[i].to);
  }
  for (int i = (1), i_end_ = (n); i <= i_end_; ++i) printf("%d ", val[c[i]]);
}
int main() {
  n = read();
  a = read();
  b = read();
  for (int i = (1), i_end_ = (n); i <= i_end_; ++i) p[i] = read(), mp[p[i]] = i;
  for (int i = (1), i_end_ = (n); i <= i_end_; ++i) {
    int exa = mp[a - p[i]];
    int exb = mp[b - p[i]];
    if (!exa && !exb) {
      puts("NO");
      return 0;
    }
    if (exa) {
      AddEdge(i, exa);
      AddEdge(exa + n, i + n);
    } else
      AddEdge(i, i + n);
    if (exb) {
      AddEdge(i + n, exb + n);
      AddEdge(exb, i);
    } else
      AddEdge(i + n, i);
  }
  for (int i = (1), i_end_ = (2 * n); i <= i_end_; ++i)
    if (!dfn[i]) tarjan(i);
  for (int i = (1), i_end_ = (n); i <= i_end_; ++i) {
    if (c[i] == c[i + n]) {
      puts("NO");
      return 0;
    }
    opp[c[i]] = c[n + i], opp[c[n + i]] = c[i];
  }
  puts("YES");
  topsort();
  return 0;
}
