#include <bits/stdc++.h>
using namespace std;
int n, x, y, i, q, p[100005], v[100005];
pair<int, int> a[100005];
int pos(int x) {
  int l = 0;
  int r = n - 1;
  while (l + 1 < r)
    if (a[(l + r) / 2].first > x)
      r = (l + r) / 2;
    else
      l = (l + r) / 2;
  if (a[l].first == x)
    return l;
  else if (a[r].first == x)
    return r;
  else
    return -1;
}
int findset(int x) {
  if (x == p[x]) return x;
  p[x] = findset(p[x]);
  return p[x];
}
void unin(int x, int y) {
  x = findset(x);
  y = findset(y);
  p[x] = y;
}
int main() {
  ;
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  ;
  cin >> n >> x >> y;
  for (i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
    p[i] = i;
  }
  sort(a, a + n);
  p[n + 1] = n + 1;
  p[n + 2] = n + 2;
  for (i = 0; i < n; i++) {
    q = pos(x - a[i].first);
    if (q == -1)
      unin(i, n + 2);
    else
      unin(i, q);
    q = pos(y - a[i].first);
    if (q == -1)
      unin(i, n + 1);
    else
      unin(i, q);
  }
  if (findset(n + 1) == findset(n + 2)) {
    cout << "NO";
    return 0;
  }
  cout << "YES \n";
  for (i = 0; i < n; i++)
    if (findset(i) == findset(n + 1))
      v[a[i].second] = 0;
    else
      v[a[i].second] = 1;
  for (i = 0; i < n; i++) cout << v[i] << " ";
}
