#include <bits/stdc++.h>
using namespace std;
int fa[100007];
int find(int x) {
  if (x == fa[x]) {
    return x;
  } else {
    return fa[x] = find(fa[x]);
  }
}
void un(int x, int y) {
  x = find(x);
  y = find(y);
  if (x == y) {
    return;
  }
  fa[y] = x;
}
int n, a, b;
int p[100007];
map<int, int> mp;
int vs[100007], qr[100007];
int main() {
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    fa[i] = i;
    scanf("%d", p + i);
    mp[p[i]] = i;
  }
  for (int i = 0; i < n; i++) {
    if (mp.count(a - p[i])) {
      un(i, mp[a - p[i]]);
      vs[i] |= 1;
    }
    if (mp.count(b - p[i])) {
      un(i, mp[b - p[i]]);
      vs[i] |= 2;
    }
  }
  for (int i = 0; i < n; i++) {
    qr[i] = 3;
  }
  for (int i = 0; i < n; i++) {
    qr[find(i)] &= vs[i];
  }
  for (int i = 0; i < n; i++) {
    if (qr[find(i)] == 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    if (qr[find(i)] == 1) {
      cout << 0;
    } else {
      cout << 1;
    }
    if (i != n - 1) {
      cout << ' ';
    }
  }
  cout << endl;
  return 0;
}
