#include <bits/stdc++.h>
using namespace std;
int n, a, b, p[100005], pr[100005], s[100005], out[100005];
map<int, int> got;
set<int> c[100005];
int f(int a) { return a == pr[a] ? a : pr[a] = f(pr[a]); }
void connect(int a, int b) {
  a = f(a), b = f(b);
  if (a == b) return;
  if (s[a] < s[b])
    pr[a] = b;
  else {
    pr[b] = a;
    if (s[a] == s[b]) s[a]++;
  }
}
int main() {
  scanf("%d %d %d", &n, &a, &b);
  for (int i = 1; i <= n; i++) scanf("%d", p + i), pr[i] = i, got[p[i]] = i;
  for (int i = 1; i <= n; i++) {
    if ((got.find(a - p[i]) != got.end())) connect(i, got[a - p[i]]);
    if ((got.find(b - p[i]) != got.end())) connect(i, got[b - p[i]]);
  }
  for (int i = 1; i <= n; i++) c[f(i)].insert(p[i]);
  for (int i = 1; i <= n; i++) {
    if (!((int)(c[i]).size())) continue;
    bool wa = true, wb = true;
    for (set<int>::iterator it = c[i].begin(); it != c[i].end(); it++) {
      wa &= (c[i].find(a - (*it)) != c[i].end());
      wb &= (c[i].find(b - (*it)) != c[i].end());
    }
    if (!wa && !wb) {
      printf("NO\n");
      return 0;
    }
    int o = (wa ? 0 : 1);
    for (set<int>::iterator it = c[i].begin(); it != c[i].end(); it++)
      out[got[*it]] = o;
  }
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d ", out[i]);
  printf("\n");
  return 0;
}
