#include <bits/stdc++.h>
using namespace std;
using namespace std;
const int MAXN = (long long int)1e6;
long long int n, a, b;
long long int arr[MAXN];
map<long long int, long long int> pos;
long long int idx_status[MAXN];
long long int status[MAXN];
long long int parents[MAXN];
long long int size[MAXN];
long long int findit(long long int x) {
  while (x != parents[x]) {
    parents[x] = parents[parents[x]], x = parents[x];
  }
  return x;
}
void join(long long int x, long long int y) {
  long long int fx = findit(x);
  long long int fy = findit(y);
  if (fx == fy) return;
  if (size[fx] >= size[fy]) {
    size[fx] += size[fy];
    parents[fy] = fx;
  } else {
    size[fy] += size[fx];
    parents[fx] = fy;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, a, b;
  cin >> n >> a >> b;
  for (long long int i = 1; i <= n; i += 1) {
    cin >> arr[i];
    pos[arr[i]] = i;
  }
  for (long long int i = 1; i <= n; i += 1) {
    parents[i] = i;
    size[i] = 1;
  }
  for (long long int i = 1; i <= n; i += 1) {
    if (pos[a - arr[i]]) {
      join(pos[a - arr[i]], i);
      idx_status[i] |= 1;
    }
    if (pos[b - arr[i]]) {
      join(pos[b - arr[i]], i);
      idx_status[i] |= 2;
    }
  }
  for (long long int i = 1; i <= n; i += 1) {
    status[i] = 3;
  }
  for (long long int i = 1; i <= n; i += 1) {
    status[findit(i)] &= idx_status[i];
  }
  for (long long int i = 1; i <= n; i += 1) {
    if (status[i] == 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (long long int i = 1; i <= n; i += 1) {
    if (i > 1) cout << " ";
    long long int x = status[findit(i)];
    if (x & 1)
      cout << "0";
    else {
      cout << "1";
    }
  }
  cout << endl;
  return 0;
}
