#include <bits/stdc++.h>
using namespace std;
const int MAX = 2000006;
const long long INF = 1000000000000000018LL;
int n;
long long a, b;
long long p[MAX];
map<long long, int> Id;
vector<long> Edge[MAX + 7];
bool Visit[MAX + 7];
bool InStk[MAX + 7];
long Low[MAX + 7], I;
long Ind[MAX + 7];
stack<long> Stk;
long nG;
long Grp[MAX + 7];
inline long NOT(long v) { return (v - 1 + n) % (2 * n) + 1; }
void SCC(long u) {
  Visit[u] = true;
  InStk[u] = true;
  Ind[u] = ++I;
  Low[u] = I;
  Stk.push(u);
  long i;
  for (i = 0; i < Edge[u].size(); i++) {
    long v = Edge[u][i];
    if (!Visit[v]) {
      SCC(v);
      Low[u] = min(Low[u], Low[v]);
    } else if (InStk[v]) {
      Low[u] = min(Low[u], Ind[v]);
    }
  }
  if (Low[u] != Ind[u]) return;
  nG++;
  while (Stk.top() != u) {
    long v = Stk.top();
    Stk.pop();
    InStk[v] = false;
    Grp[v] = nG;
  }
  Stk.pop();
  InStk[u] = false;
  Grp[u] = nG;
}
int main() {
  int i, j, k;
  cin >> n >> a >> b;
  for (i = 1; i <= n; i++) {
    cin >> p[i];
    Id[p[i]] = i;
  }
  for (i = 1; i <= n; i++) {
    if (!Id.count(a - p[i])) {
      Edge[NOT(i)].push_back(i);
    } else {
      j = Id[a - p[i]];
      Edge[NOT(i)].push_back(NOT(j));
      Edge[j].push_back(i);
    }
    if (!Id.count(b - p[i])) {
      Edge[i].push_back(NOT(i));
    } else {
      j = Id[b - p[i]];
      Edge[i].push_back(j);
      Edge[NOT(j)].push_back(NOT(i));
    }
  }
  memset(Visit, 0, sizeof(Visit));
  memset(InStk, 0, sizeof(InStk));
  nG = 0;
  I = 0;
  for (i = 1; i <= 2 * n; i++) {
    if (Visit[i]) continue;
    SCC(i);
  }
  for (i = 1; i <= n; i++) {
    if (Grp[i] == Grp[n + i]) break;
  }
  if (i <= n) {
    printf("NO\n");
    return 0;
  } else {
    printf("YES\n");
    for (i = 1; i <= n; i++) {
      if (i > 1) printf(" ");
      if (Grp[i] < Grp[NOT(i)])
        printf("1");
      else
        printf("0");
    }
    printf("\n");
  }
  return 0;
}
