#include <bits/stdc++.h>
using namespace std;
int n, a, b, g[100000][2], res[100000];
map<int, int> vec;
bool colour(int p, int col, int u) {
  if (g[u][col] == -1) return false;
  bool ret = true;
  int v = g[u][0];
  if (v != -1 && v != p) ret &= colour(u, col, v);
  v = g[u][1];
  if (v != -1 && v != p) ret &= colour(u, col, v);
  if (!ret)
    res[u] = -1;
  else
    res[u] = col;
  return ret;
}
int main() {
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    vec[tmp] = i;
    g[i][0] = g[i][1] = -1;
    res[i] = -1;
  }
  for (map<int, int>::iterator it = vec.begin(); it != vec.end(); it++) {
    int x = it->first;
    int k = a - x;
    if (vec.count(k)) g[it->second][0] = vec[k];
    k = b - x;
    if (vec.count(k)) g[it->second][1] = vec[k];
  }
  bool ans = true;
  for (int i = 0; i < n; i++) {
    if (res[i] == -1) {
      if (!colour(-1, 0, i)) ans &= colour(-1, 1, i);
    }
  }
  if (!ans)
    cout << "NO\n";
  else {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      if (i > 0) cout << " ";
      cout << res[i];
    }
    cout << "\n";
  }
  return 0;
}
