#include <bits/stdc++.h>
using namespace std;
int n, a, b;
map<int, int> table;
int inp[100100];
int dsu[100100];
void init() {
  for (int i = 1; i <= n; i++) dsu[i] = i;
}
int getfa(int pos) {
  if (dsu[pos] == pos) return pos;
  return dsu[pos] = getfa(dsu[pos]);
}
void unite(int a, int b) {
  a = getfa(a);
  b = getfa(b);
  dsu[b] = a;
}
int main() {
  cin >> n;
  cin >> a;
  cin >> b;
  init();
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    table[x] = i;
    inp[i] = x;
  }
  short int bit[100100];
  short int bit2[100100];
  for (int i = 1; i <= n; i++) {
    int x = inp[i];
    if (table.count(a - x)) {
      unite(i, table[a - x]);
      bit[i] |= 1;
    }
    if (table.count(b - x)) {
      unite(i, table[b - x]);
      bit[i] |= 2;
    }
    if (!bit[i]) {
      cout << "NO" << endl;
      return 0;
    }
    bit2[i] = 3;
  }
  for (int i = 1; i <= n; i++) {
    bit2[getfa(i)] &= bit[i];
    if (!bit2[getfa(i)]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    if (bit2[getfa(i)] == 1)
      cout << 0;
    else
      cout << 1;
    cout << " ";
  }
  cout << endl;
  return 0;
}
