#include <bits/stdc++.h>
using namespace std;
int inline in() {
  int x;
  scanf("%d", &x);
  return x;
}
long long inline lin() {
  long long x;
  scanf("%I64d", &x);
  return x;
}
void P(long long x) { printf("%I64d", x); }
long long a[100010], rslt[100010], check[100010];
map<long long, long long> namira, namira1;
int main() {
  long long i, j;
  long long n = lin();
  long long A = lin();
  long long B = lin();
  long long x = 1, y = 2;
  if (A >= B) {
    x = 2, y = 1;
  }
  long long d = min(A, B);
  long long d1 = A + B - d;
  for (i = 1; i <= n; i++) {
    a[i] = lin();
    namira[a[i]] = i;
    if (a[i] >= d1) {
      puts("NO");
      return 0;
    }
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) {
    namira1[a[i]] = i;
  }
  long long first = 1, last = n;
  while (first <= last) {
    if (a[first] >= d) break;
    if (namira1[d - a[first]]) {
      last = namira1[d - a[first]];
      check[first] = x;
      check[last] = x;
    }
    first++;
  }
  for (i = 1; i <= n; i++) {
    if (check[i] == 0) {
      if (namira1[d1 - a[i]]) {
        long long g = d1 - a[i];
        long long f = namira1[g];
        if (check[f] == x) {
          while (1) {
            if (g + g == d) {
              check[namira1[g]] = y;
              check[i] = y;
              break;
            }
            long long h = d - g;
            long long h1 = d1 - h;
            if (namira1[h1]) {
              check[namira1[h]] = y;
              check[i] = y;
              check[f] = y;
            } else {
              puts("NO");
              return 0;
            }
            if (check[namira1[h1]] == 0) {
              check[namira1[h1]] = y;
              break;
            } else {
              check[namira1[h1]] = y;
              g = h1;
            }
          }
        } else {
          check[f] = y;
          check[i] = y;
        }
      } else {
        puts("NO");
        return 0;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    if (check[i] == 0) {
      puts("NO");
      return 0;
    } else {
      rslt[namira[a[i]]] = check[i] - 1;
    }
  }
  puts("YES");
  for (i = 1; i <= n; i++) {
    P(rslt[i]);
    printf(" ");
  }
  return 0;
}
