#include <bits/stdc++.h>
using namespace std;
const int maxn = 100003;
int n, a, b;
int p[maxn];
map<int, int> used;
int maxp = 0;
int rootA;
int rootB;
void input() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &p[i]);
    used[p[i]] = i;
  }
  rootA = n + 1;
  rootB = n + 2;
}
int f[maxn << 1];
inline int findf(int x) {
  if (f[x] != x) f[x] = findf(f[x]);
  return f[x];
}
inline void unite(int a, int b) {
  int fa = findf(a), fb = findf(b);
  if (fa != fb) {
    f[fa] = fb;
  }
}
void work() {
  for (int i = 1; i <= n + 2; ++i) {
    f[i] = i;
  }
  for (int i = 1; i <= n; ++i) {
    if (used[a - p[i]] > 0)
      unite(i, used[a - p[i]]);
    else
      unite(i, rootB);
    if (used[b - p[i]] > 0)
      unite(i, used[b - p[i]]);
    else
      unite(i, rootA);
  }
}
int main() {
  input();
  work();
  if (findf(rootA) != findf(rootB)) {
    printf("YES\n");
    for (int i = 1; i <= n; ++i) {
      if (findf(i) == findf(rootA)) {
        printf("0 ");
      } else {
        printf("1 ");
      }
    }
  } else
    printf("NO\n");
  return 0;
}
