#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int A[100010], vi[100010], sta[100010];
map<int, int> has;
int fa[100010];
int find(int i) { return fa[i] == i ? i : fa[i] = find(fa[i]); }
void Work() {
  for (int i = 1; i <= n; i++) {
    if (has.count(a - A[i])) fa[find(has[a - A[i]])] = find(i), vi[i] |= 1;
    if (has.count(b - A[i])) fa[find(has[b - A[i]])] = find(i), vi[i] |= 2;
  }
  for (int i = 1; i <= n; i++) sta[i] = 3;
  for (int i = 1; i <= n; i++) sta[find(i)] &= vi[i];
  for (int i = 1; i <= n; i++)
    if (!sta[i]) {
      puts("NO");
      return;
    }
  puts("YES");
  for (int i = 1; i <= n; i++) printf("%d ", (sta[find(i)] & 1) == 0);
}
void Init() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 1; i <= n; i++) scanf("%d", &A[i]), has[A[i]] = i, fa[i] = i;
}
int main() {
  Init();
  Work();
  return 0;
}
