#include <bits/stdc++.h>
using namespace std;
int P[100010], R[100010];
int nos[100010];
int findS(int x) {
  if (P[x] != x) P[x] = findS(P[x]);
  return P[x];
}
void mergeS(int x, int y) {
  int px = findS(x), py = findS(y);
  if (px == py) return;
  if (R[px] > R[py])
    P[py] = px;
  else
    P[px] = py;
  if (R[px] == R[py]) R[py] += 1;
}
map<int, int> m;
int ans[100010];
int main() {
  int N, A, B;
  cin >> N >> A >> B;
  for (int i = 0; i < N; i++) cin >> nos[i];
  for (int i = 0; i < N; i++) P[i] = i;
  for (int i = 0; i < N; i++) m[nos[i]] = i;
  for (int i = 0; i < N; i++) {
    int x = nos[i], ax = A - x, bx = B - x;
    if (m.count(ax) != 0) mergeS(i, m[ax]);
    if (m.count(bx) != 0) mergeS(i, m[bx]);
  }
  map<int, set<int>> sets;
  for (int i = 0; i < N; i++) sets[findS(i)].insert(nos[i]);
  for (auto s : sets) {
    bool ap = true, bp = true;
    for (auto x : s.second) {
      if (ap && !s.second.count(A - x)) ap = false;
      if (bp && !s.second.count(B - x)) bp = false;
    }
    if (ap)
      for (auto x : s.second) ans[m[x]] = 0;
    else if (bp)
      for (auto x : s.second) ans[m[x]] = 1;
    else {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < N; i++) cout << ans[i] << " ";
  cout << endl;
}
