#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int id;
set<int> p;
map<int, int> oo;
int f[123456];
int c[123456];
int find_(int x) {
  if (f[x] == x)
    return x;
  else
    return f[x] = find_(f[x]);
}
void union_(int x, int y) {
  int xx = find_(x);
  int yy = find_(y);
  if (xx == yy) return;
  f[yy] = xx;
}
int main() {
  cin >> n >> a >> b;
  id = 0;
  for (int i = (1); i <= (n); ++i) {
    scanf("%d", &c[i]);
    p.insert(c[i]);
    oo[c[i]] = ++id;
    f[i] = i;
  }
  f[n + 1] = n + 1;
  f[n + 2] = n + 2;
  for (int i = (1); i <= (n); ++i) {
    if (p.count(a - c[i])) {
      union_(oo[c[i]], oo[a - c[i]]);
    } else
      union_(oo[c[i]], n + 1);
    if (p.count(b - c[i])) {
      union_(oo[c[i]], oo[b - c[i]]);
    } else
      union_(oo[c[i]], n + 2);
  }
  if (find_(n + 1) == find_(n + 2))
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = (1); i <= (n); ++i) {
      printf("%d ", find_(i) == find_(n + 1));
    }
    puts("");
  }
  return 0;
}
