#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 4;
int n, A, B, a[N], par[N];
map<int, int> Map;
int root(int u) { return (par[u] < 0) ? u : (par[u] = root(par[u])); }
void Merge(int u, int v) {
  u = root(u);
  v = root(v);
  if (u != v) {
    if (par[u] > par[v]) swap(u, v);
    par[u] += par[v];
    par[v] = u;
  }
}
void sol() {
  for (int i = 0; i <= n + 1; ++i) par[i] = -1;
  for (int i = 1; i <= n; ++i) {
    if (Map.count(A - a[i]))
      Merge(i, Map[A - a[i]]);
    else
      Merge(i, n + 1);
    if (Map.count(B - a[i]))
      Merge(i, Map[B - a[i]]);
    else
      Merge(i, 0);
  }
  int u = root(0), v = root(n + 1);
  if (u == v)
    cout << "NO";
  else {
    cout << "YES \n";
    for (int i = 1; i <= n; ++i) {
      int tmp = root(i);
      if (tmp == u)
        cout << 0 << " ";
      else
        cout << 1 << " ";
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> A >> B;
  for (int i = 1; i <= n; ++i) cin >> a[i], Map[a[i]] = i;
  sol();
  return 0;
}
