#include <bits/stdc++.h>
using namespace std;
vector<int> adj[400000];
int n;
int ncomp;
int comp[400000];
long long p[400000];
int X[400000];
int vis[400000], stck[400000], t, high[400000];
int num;
long long a, b;
void dfscc(int u) {
  int i, v;
  high[u] = vis[u] = num--;
  stck[t++] = u;
  for (i = 0; i < (int)adj[u].size(); i++) {
    v = adj[u][i];
    if (!vis[v]) {
      dfscc(v);
      high[u] = max(high[u], high[v]);
    } else if (vis[v] > vis[u] && !comp[v])
      high[u] = max(high[u], vis[v]);
  }
  if (high[u] == vis[u]) {
    ncomp++;
    do {
      v = stck[--t];
      comp[v] = ncomp;
    } while (v != u);
  }
}
void scc(int n) {
  ncomp = t = 0;
  num = n;
  memset(vis, 0, sizeof(int) * n);
  memset(comp, 0, sizeof(int) * n);
  for (int i = 0; i < n; i++)
    if (!vis[i]) dfscc(i);
}
bool two_sat(int n) {
  n *= 2;
  scc(n);
  for (int i = 0; i < n / 2; i++) {
    if (comp[2 * i] == comp[2 * i + 1]) return false;
  }
  return true;
}
int getsol(int x) { return (comp[2 * x] < comp[2 * x + 1] ? 1 : 0); }
void clau(int x, int y) {
  int negx = ((x) ^ 1), negy = ((y) ^ 1);
  adj[negx].push_back(y);
  adj[negy].push_back(x);
}
bool solve() {
  int nxta = n - 1;
  int nxtb = n - 1;
  for (int i = 0; i < n; i++) {
    bool ga = false, gb = false;
    while (nxta >= 0) {
      if (a - p[X[i]] == p[X[nxta]]) {
        clau((2 * (X[i]) + 1), (2 * (X[nxta])));
        ga = true;
        break;
      } else if (a - p[X[i]] < p[X[nxta]]) {
        nxta--;
      } else
        break;
    }
    while (nxtb >= 0) {
      if (b - p[X[i]] == p[X[nxtb]]) {
        clau((2 * (X[i])), (2 * (X[nxtb]) + 1));
        gb = true;
        break;
      } else if (b - p[X[i]] < p[X[nxtb]]) {
        nxtb--;
      } else
        break;
    }
    if (!ga && !gb)
      return false;
    else if (ga && !gb) {
      clau((2 * (X[i])), (2 * (X[i])));
    } else if (gb && !ga) {
      clau((2 * (X[i]) + 1), (2 * (X[i]) + 1));
    }
  }
  if (two_sat(n)) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      if (i > 0) cout << " ";
      cout << 1 - getsol(i);
    }
    cout << "\n";
    return true;
  } else
    return false;
}
bool cmp(int x, int y) { return p[x] < p[y]; }
int main() {
  while (cin >> n >> a >> b) {
    for (int i = 0; i < n; i++) {
      cin >> p[i];
    }
    for (int i = 0; i < 2 * n; i++) adj[i].clear();
    for (int i = 0; i < n; i++) X[i] = i;
    sort(X, X + n, cmp);
    if (!solve()) {
      cout << "NO\n";
    }
  }
  return 0;
}
