#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> m, val, pos;
void fail() {
  cout << "NO";
  exit(0);
}
void ck(long long int p, long long int q, long long int z) {
  if (val[q] == 1 || m[q] == 0) fail();
  val[p] = 1;
  val[q] = 1;
  pos[p] = z;
  pos[q] = z;
}
long long int a[1000002];
long long int b[1000002];
int main() {
  long long int n, i, j, k, l, x, y, f, z, p, q;
  f = 0;
  z = 1;
  cin >> n >> x >> y;
  if (x > y) {
    swap(x, y);
    swap(f, z);
  }
  for (i = 0; i < int(n); i++) {
    cin >> a[i];
    b[i] = a[i];
    m[a[i]] = i + 1;
  }
  sort(a, a + n);
  for (i = n - 1; i >= 0; i--) {
    p = a[i];
    if (val[p] == 1) continue;
    if (p >= y)
      fail();
    else if (p >= x) {
      q = y - p;
      ck(p, q, z);
    } else {
      q = x - p;
      if (val[q] == 1 || m[q] == 0)
        ck(p, y - p, z);
      else
        ck(p, q, f);
    }
  }
  cout << "YES" << endl;
  for (i = 0; i < n; i++) {
    cout << pos[b[i]] << " ";
  }
}
