#include <bits/stdc++.h>
using namespace std;
map<int, int> myset;
vector<int> f[100005];
int n, a, b;
int d[100005];
int e[100005];
queue<int> pq;
bool ok = 0;
int main() {
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) {
    cin >> d[i];
    myset[d[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    if (myset.find(a - d[i]) == myset.end() &&
        myset.find(b - d[i]) == myset.end()) {
      ok = 1;
      break;
    } else {
      if (myset.find(a - d[i]) != myset.end() &&
          myset.find(b - d[i]) != myset.end()) {
        int u = myset[a - d[i]], v = myset[b - d[i]];
        e[i] = 2;
        if (u < i) {
          f[u].push_back(i);
          f[i].push_back(u);
        }
        if (v < i) {
          f[v].push_back(i);
          f[i].push_back(v);
        }
      } else {
        if (myset.find(a - d[i]) != myset.end()) {
          int u = myset[a - d[i]];
          e[i] = 0;
          if (u < i) {
            f[u].push_back(i);
            f[i].push_back(u);
          }
        } else {
          int u = myset[b - d[i]];
          pq.push(i);
          e[i] = 1;
          if (u < i) {
            f[u].push_back(i);
            f[i].push_back(u);
          }
        }
      }
    }
  }
  if (ok == 1)
    cout << "NO";
  else {
    while (pq.size() != 0 && ok == 0) {
      int u = pq.front();
      pq.pop();
      for (int i = 0; i < f[u].size() && ok == 0; i++) {
        int v = f[u][i];
        if (e[v] == 1) continue;
        if (e[v] == 0) {
          ok = 1;
          break;
        }
        e[v] = 1;
        pq.push(v);
      }
    }
    if (ok == 1)
      cout << "NO";
    else {
      for (int i = 1; i <= n; i++)
        if (e[i] == 0) pq.push(i);
      while (pq.size() != 0 && ok == 0) {
        int u = pq.front();
        pq.pop();
        for (int i = 0; i < f[u].size() && ok == 0; i++) {
          int v = f[u][i];
          if (e[v] == 0) continue;
          if (e[v] == 1) {
            ok = 1;
            break;
          }
          e[v] = 0;
          pq.push(v);
        }
      }
      if (ok == 1)
        cout << "NO";
      else {
        cout << "YES \n";
        for (int i = 1; i <= n; i++) {
          if (e[i] == 2)
            cout << 0 << " ";
          else
            cout << e[i] << " ";
        }
      }
    }
  }
  return 0;
}
