#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
map<int, int> mp;
int N, a, b, p[MAXN], ans[MAXN];
bool loopend;
int chain(int i, int f, int c) {
  if (ans[i] != -1) {
    loopend = true;
    return 0;
  }
  ans[i] = c;
  if (f == 0) {
    if (mp.count(b - p[i]))
      return 1 + chain(mp[b - p[i]], 1, c);
    else
      return 1;
  } else {
    if (mp.count(a - p[i]))
      return 1 + chain(mp[a - p[i]], 0, c);
    else
      return 1;
  }
}
bool DEBUG = false;
int main() {
  scanf("%d", &N);
  scanf("%d", &a), scanf("%d", &b);
  for (int i = 0; i < (int)N; i++) {
    scanf("%d", &p[i]);
    mp[p[i]] = i;
  }
  if (a == b) {
    bool good = true;
    for (int i = 0; i < (int)N; i++)
      if (!mp.count(a - p[i])) good = false;
    if (good) {
      printf("YES\n");
      for (int i = 0; i < (int)N; i++) printf("1%c", " \n"[i == N - 1]);
    } else {
      printf("NO\n");
    }
    return 0;
  }
  bool good = true;
  memset(ans, -1, sizeof(ans));
  for (int i = 0; i < (int)N; i++) {
    if (DEBUG)
      printf("p[%d]=%d,   %d(%d)  %d(%d)\n", i, p[i], a - p[i],
             (int)mp.count(a - p[i]), b - p[i], (int)mp.count(b - p[i]));
    if (!mp.count(a - p[i]) && mp.count(b - p[i])) {
      if (ans[i] == -1) {
        if (DEBUG) printf("p[%d]=%d   starts b\n", i, p[i]);
        loopend = false;
        int cnt = chain(i, 0, 1);
        if (cnt % 2 && !loopend) good = false;
      }
    } else if (!mp.count(b - p[i]) && mp.count(a - p[i])) {
      if (ans[i] == -1) {
        if (DEBUG) printf("p[%d]=%d   starts a\n", i, p[i]);
        loopend = false;
        int cnt = chain(i, 1, 0);
        if (cnt % 2 && !loopend) good = false;
      }
    } else if (!mp.count(a - p[i]) && !mp.count(b - p[i])) {
      if (DEBUG) printf("p[%d]=%d   alone\n", i, p[i]);
      good = false;
    }
  }
  if (good) {
    printf("YES\n");
    for (int i = 0; i < (int)N; i++) printf("%d%c", ans[i], " \n"[i == N - 1]);
  } else {
    printf("NO\n");
  }
}
