#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
const int MOD = 10007;
vector<int> adj[2 * 200005];
int col[2 * 200005], low[2 * 200005], tim[2 * 200005], timer;
int group_id[2 * 200005], components;
bool ans[200005];
stack<int> S;
void scc(int u) {
  int i, v, tem;
  col[u] = 1;
  low[u] = tim[u] = timer++;
  S.push(u);
  for (int i = 0; i <= ((int)adj[u].size()) - 1; ++i) {
    v = adj[u][i];
    if (col[v] == 1)
      low[u] = min(low[u], tim[v]);
    else if (col[v] == 0) {
      scc(v);
      low[u] = min(low[u], low[v]);
    }
  }
  if (low[u] == tim[u]) {
    do {
      tem = S.top();
      S.pop();
      group_id[tem] = components;
      col[tem] = 2;
    } while (tem != u);
    components++;
  }
}
int TarjanSCC(int n) {
  int i;
  timer = components = 0;
  memset(col, 0, sizeof(col));
  while (!S.empty()) S.pop();
  for (int i = 0; i <= n - 1; ++i)
    if (col[i] == 0) scc(i);
  return components;
}
bool TwoSAT(int n) {
  TarjanSCC(n);
  int i;
  for (i = 0; i < n; i += 2) {
    if (group_id[i] == group_id[i + 1]) return false;
    if (group_id[i] < group_id[i + 1])
      ans[i / 2] = true;
    else
      ans[i / 2] = false;
  }
  return true;
}
void add(int ina, int inb) { adj[ina].push_back(inb); }
int makeinv(int x) {
  if (x % 2) return (x - 1);
  return (x + 1);
}
map<int, int> mp;
long long data[200005];
int main(int argc, const char **argv) {
  int N, A, B, num;
  scanf("%d %d %d", &N, &A, &B);
  for (int i = 0; i <= (N - 1); ++i) {
    scanf("%d", &data[i]);
    mp[data[i]] = i;
  }
  for (int i = 0; i <= (N - 1); ++i) {
    if (mp.find(A - data[i]) == mp.end()) {
      add(2 * i, 2 * i + 1);
    } else {
      add(2 * i, 2 * mp[A - data[i]]);
      add(2 * i + 1, 2 * mp[A - data[i]] + 1);
    }
    if (mp.find(B - data[i]) == mp.end()) {
      add(2 * i + 1, 2 * i);
    } else {
      add(2 * i + 1, 2 * mp[B - data[i]] + 1);
      add(2 * i, 2 * mp[B - data[i]]);
    }
  }
  if (!TwoSAT(2 * N))
    printf("NO\n");
  else {
    printf("YES\n");
    for (int i = 0; i <= (N - 1); ++i) {
      if (ans[i])
        printf("0 ");
      else
        printf("1 ");
    }
    printf("\n");
  }
  return 0;
}
