#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100000];
long long p[100000];
int X[100000];
long long a, b;
bool xa[100000], xb[100000];
int pos[100000];
int vis[100000];
int n;
bool solve() {
  int nxta = n - 1;
  int nxtb = n - 1;
  memset(xa, false, sizeof(bool) * n);
  memset(xb, false, sizeof(bool) * n);
  memset(pos, 0, sizeof(int) * n);
  memset(vis, 0, sizeof(int) * n);
  for (int i = 0; i < n; i++) {
    bool ga = false, gb = false;
    while (nxta >= 0) {
      if (a - p[X[i]] == p[X[nxta]]) {
        adj[X[i]].push_back(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]]) {
        adj[X[i]].push_back(X[nxtb]);
        gb = true;
        break;
      } else if (b - p[X[i]] < p[X[nxtb]]) {
        nxtb--;
      } else
        break;
    }
    if (!ga && !gb)
      return false;
    else if (ga && !gb) {
      xa[X[i]] = true;
    } else if (gb && !ga) {
      xb[X[i]] = true;
    }
  }
  for (int i = 0; i < n; i++) {
    if (!vis[i] && (xa[i] || xb[i])) {
      stack<int> s;
      pos[i] = (xa[i] ? 0 : 1);
      vis[i] = 1;
      s.push(i);
      while (!s.empty()) {
        int x = s.top();
        s.pop();
        for (int y : adj[x]) {
          if (!vis[y]) {
            vis[y] = 1;
            s.push(y);
            pos[y] = pos[i];
          }
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (xa[i] && pos[i] == 1) return false;
    if (xb[i] && pos[i] == 0) return false;
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    if (i > 0) cout << " ";
    cout << pos[i];
  }
  cout << "\n";
  return true;
}
bool cmp(int a, int b) { return p[a] < p[b]; }
int main() {
  while (cin >> n >> a >> b) {
    for (int i = 0; i < n; i++) {
      cin >> p[i];
    }
    for (int i = 0; i < 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;
}
