#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 12;
int n, a, b, x[N], vis[N], mask, col[N], color;
vector<pair<int, int> > G[N];
vector<int> pts;
map<int, int> m;
void dfs(int v) {
  vis[v] = 1;
  pts.push_back(v);
  if (G[v].size() == 1) {
    mask |= G[v][0].first;
  }
  for (int i = 0; i < G[v].size(); i++) {
    int u = G[v][i].second;
    if (vis[u]) continue;
    dfs(u);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    m[x[i]] = i;
  }
  if (a == b) {
    for (int i = 1; i <= n; i++) {
      int v = m[a - x[i]];
      if (v) G[i].push_back(make_pair(1, v));
    }
  } else {
    for (int i = 1; i <= n; i++) {
      int v = m[a - x[i]];
      if (v) G[i].push_back(make_pair(1, v));
      v = m[b - x[i]];
      if (v) G[i].push_back(make_pair(2, v));
    }
  }
  for (int i = 1; i <= n; i++) {
    if (vis[i]) continue;
    pts.clear();
    mask = 0;
    dfs(i);
    if (mask == 3 || mask == 0) {
      cout << "NO" << endl;
      return 0;
    } else if (mask == 1) {
      color = 0;
    } else
      color = 1;
    for (int j = 0; j < pts.size(); j++) {
      col[pts[j]] = color;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << col[i] << " ";
  return 0;
}
