#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
int head[2 * MAXN], tol, mark[2 * MAXN], S[2 * MAXN], c, n;
struct node {
  int next, to;
} edge[MAXN * 4];
void add(int u, int v) {
  edge[tol].to = v;
  edge[tol].next = head[u];
  head[u] = tol++;
}
bool dfs(int x) {
  if (mark[x ^ 1]) return 0;
  if (mark[x]) return 1;
  mark[x] = 1;
  S[c++] = x;
  for (int i = head[x]; i != -1; i = edge[i].next) {
    int v = edge[i].to;
    if (!dfs(v)) return 0;
  }
  return 1;
}
bool solve() {
  for (int i = 0; i < 2 * n; i += 2)
    if (!mark[i] && !mark[i + 1]) {
      c = 0;
      if (!dfs(i)) {
        while (c > 0) mark[S[--c]] = 0;
        if (!dfs(i + 1)) return 0;
      }
    }
  return 1;
}
map<int, int> mp;
int a[MAXN], b[MAXN];
int main() {
  int i, j, k, A, B;
  while (~scanf("%d%d%d", &n, &A, &B)) {
    memset(head, -1, sizeof(head));
    memset(mark, 0, sizeof(mark));
    mp.clear();
    tol = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &a[i]);
      mp[a[i]] = i;
    }
    for (i = 0; i < n; i++) {
      int t1 = mp.count(A - a[i]), t2 = mp.count(B - a[i]);
      if (t1 > 0 && t2 > 0) {
        add(2 * mp[a[i]], 2 * mp[A - a[i]]);
        add(2 * mp[a[i]] + 1, 2 * mp[A - a[i]] + 1);
        add(2 * mp[a[i]], 2 * mp[B - a[i]]);
        add(2 * mp[a[i]] + 1, 2 * mp[B - a[i]] + 1);
      } else if (t1 > 0) {
        add(2 * mp[a[i]] + 1, 2 * mp[a[i]]);
        add(2 * mp[a[i]], 2 * mp[A - a[i]]);
        add(2 * mp[a[i]] + 1, 2 * mp[A - a[i]] + 1);
      } else if (t2 > 0) {
        add(2 * mp[a[i]], 2 * mp[a[i]] + 1);
        add(2 * mp[a[i]], 2 * mp[B - a[i]]);
        add(2 * mp[a[i]] + 1, 2 * mp[B - a[i]] + 1);
      } else {
        goto im;
      }
    }
    if (solve()) {
      puts("YES");
      for (i = 0; i < 2 * n; i += 2) printf("%d ", mark[i + 1]);
      continue;
    }
  im:
    puts("NO");
  }
  return 0;
}
