#include <bits/stdc++.h>
using namespace std;
const int MAX_V = 200500;
int V;
vector<int> G[MAX_V], rG[MAX_V];
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];
void add_edge(int f, int t) {
  G[f].push_back(t);
  rG[t].push_back(f);
}
void dfs(int v) {
  used[v] = true;
  for (int i = G[v].size() - 1; i >= 0; i--) {
    if (!used[G[v][i]]) dfs(G[v][i]);
  }
  vs.push_back(v);
}
void rdfs(int v, int k) {
  used[v] = true;
  cmp[v] = k;
  for (int i = rG[v].size() - 1; i >= 0; i--) {
    if (!used[rG[v][i]]) rdfs(rG[v][i], k);
  }
}
int scc() {
  memset(used, 0, sizeof used);
  vs.clear();
  for (int v = 0; v < V; v++) {
    if (!used[v]) dfs(v);
  }
  memset(used, 0, sizeof used);
  int k = 0;
  for (int i = vs.size() - 1; i >= 0; i--) {
    if (!used[vs[i]]) rdfs(vs[i], k++);
  }
  return k;
}
int n, a, b;
int ar[100100];
map<int, int> ma;
set<int> se;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    ma[ar[i]] = i;
    se.insert(ar[i]);
  }
  V = 2 * n;
  for (int i = 0; i < n; i++) {
    if (ar[i] != a - ar[i]) {
      if (se.count(a - ar[i])) {
        add_edge(i, ma[a - ar[i]]);
        add_edge(ma[a - ar[i]] + n, i + n);
      } else {
        add_edge(i, i + n);
      }
    }
    if (ar[i] != b - ar[i]) {
      if (se.count(b - ar[i])) {
        add_edge(i + n, ma[b - ar[i]] + n);
        add_edge(ma[b - ar[i]], i);
      } else {
        add_edge(i + n, i);
      }
    }
  }
  int k = scc();
  for (int i = 0; i < n; i++) {
    if (cmp[i] == cmp[i + n]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    if (cmp[i] > cmp[n + i])
      cout << 0;
    else
      cout << 1;
    if (i != n - 1) cout << " ";
  }
}
