#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int n, a, b;
int niz[MAXN];
int bio[MAXN];
map<int, int> mapa;
vector<pair<int, int> > graf[MAXN][2];
vector<int> izbrisi;
int dfs(int cvor, int val) {
  if (bio[cvor] != -1) return (bio[cvor] == val);
  bio[cvor] = val;
  izbrisi.push_back(cvor);
  for (int i = 0; i < graf[cvor][val].size(); i++)
    if (!dfs(graf[cvor][val][i].first, graf[cvor][val][i].second)) return 0;
  return 1;
}
void rijesi() {
  memset(bio, -1, sizeof(bio));
  for (int i = 1; i <= n; i++) {
    if (bio[i] != -1) continue;
    if (!dfs(i, 0)) {
      for (int j = 0; j < izbrisi.size(); j++) bio[izbrisi[j]] = -1;
      izbrisi.clear();
      if (!dfs(i, 1)) {
        printf("NO\n");
        exit(0);
      }
    }
    izbrisi.clear();
  }
}
int main() {
  scanf("%d %d %d", &n, &a, &b);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &niz[i]);
    mapa[niz[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    int indeks = mapa[a - niz[i]];
    if (indeks > 0) {
      graf[i][0].push_back(pair<int, int>(indeks, 0));
      graf[i][1].push_back(pair<int, int>(indeks, 1));
    } else
      graf[i][0].push_back(pair<int, int>(i, 1));
    indeks = mapa[b - niz[i]];
    if (indeks > 0) {
      graf[i][1].push_back(pair<int, int>(indeks, 1));
      graf[i][0].push_back(pair<int, int>(indeks, 0));
    } else
      graf[i][1].push_back(pair<int, int>(i, 0));
  }
  rijesi();
  printf("YES\n");
  for (int i = 1; i <= n; i++) printf("%d ", bio[i]);
  printf("\n");
  return 0;
}
