#include <bits/stdc++.h>
using namespace std;
int n, a, b;
map<int, int> ma;
set<int> st;
queue<int> qu;
vector<vector<int> > adj;
vector<int> p, res, vis;
bool flag;
void go() {
  while (!qu.empty()) {
    int u = qu.front();
    qu.pop();
    if (vis[u]) continue;
    vis[u] = 1;
    bool ok = 0;
    for (int i = 0; i < adj[u].size(); i++)
      if (!vis[adj[u][i]]) {
        if (p[adj[u][i]] + p[u] == a) {
          int v = adj[u][i];
          res[u] = res[v] = 0;
          vis[v] = 1;
          for (int j = 0; j < adj[v].size(); j++)
            if (!vis[adj[v][j]]) qu.push(adj[v][j]);
          ok = 1;
          break;
        } else {
          int v = adj[u][i];
          res[u] = res[v] = 1;
          vis[v] = 1;
          for (int j = 0; j < adj[v].size(); j++)
            if (!vis[adj[v][j]]) qu.push(adj[v][j]);
          ok = 1;
          break;
        }
      }
    if (2 * p[u] == a) ok = 1;
    if (2 * p[u] == b) {
      ok = 1;
      res[u] = 1;
    }
    if (!ok) {
      flag = 1;
      return;
    }
  }
}
int main() {
  scanf("%d %d %d ", &n, &a, &b);
  p.assign(n, 0);
  adj.assign(n, vector<int>(0));
  res.assign(n, 0);
  vis.assign(n, 0);
  for (int i = 0; i < n; i++) scanf("%d ", &p[i]);
  for (int i = 0; i < n; i++) ma[p[i]] = i;
  for (int i = 0; i < n; i++) st.insert(p[i]);
  for (int i = 0; i < n; i++) {
    if (2 * p[i] != a && st.find(a - p[i]) != st.end())
      adj[i].push_back(ma[a - p[i]]);
    if (2 * p[i] != b && st.find(b - p[i]) != st.end())
      adj[i].push_back(ma[b - p[i]]);
    if (adj[i].empty() && 2 * p[i] != a && 2 * p[i] != b) {
      printf("NO");
      return 0;
    }
    if (adj[i].size() == 1 && 2 * p[i] != a && 2 * p[i] != b) qu.push(i);
  }
  go();
  for (int i = 0; i < n; i++)
    if (!vis[i] && 2 * p[i] != a && 2 * p[i] != b) {
      if (flag) {
        printf("NO");
        return 0;
      }
      qu.push(i);
      go();
    }
  if (flag) {
    printf("NO");
    return 0;
  }
  for (int i = 0; i < n; i++)
    if (!vis[i] && 2 * p[i] == b) res[i] = 1;
  printf("YES\n");
  for (int i = 0; i < n; i++) printf("%d ", res[i]);
  return 0;
}
