#include <bits/stdc++.h>
using namespace std;
struct node {
  int val, node_id, ans;
  friend bool operator<(const node& n1, const node& n2);
};
bool operator<(const node& n1, const node& n2) { return n1.val < n2.val; }
bool cmp(const node& n1, const node& n2) { return n1.node_id < n2.node_id; }
int n, x, y;
node a[100005];
int father[100005];
int ans[100005];
bool visited[100005];
int GetFather(int pos);
void Line(int p1, int p2);
int Find(int val);
bool check(int val, int flag, int flag2);
int main() {
  int i, j, k;
  int p1, p2;
  cin >> n >> x >> y;
  for (i = 1; i <= n; i++) {
    cin >> a[i].val;
    a[i].node_id = i;
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) father[i] = i;
  for (i = 1; i <= n; i++) {
    p1 = Find(x - a[i].val);
    if (p1 != -1) {
      Line(p1, i);
    }
    p2 = Find(y - a[i].val);
    if (p2 != -1) {
      Line(p2, i);
    }
    if (p1 == -1 && p2 == -1) {
      cout << "NO" << endl;
      return 0;
    }
  }
  memset(ans, -1, sizeof(ans));
  memset(visited, false, sizeof(visited));
  for (i = 1; i <= n; i++) {
    p1 = GetFather(i);
    if (ans[p1] != -1) continue;
    memset(visited, false, sizeof(visited));
    visited[p1] = true;
    if (check(a[p1].val, x, y)) {
      ans[p1] = 0;
      continue;
    }
    memset(visited, false, sizeof(visited));
    visited[p1] = true;
    if (check(a[p1].val, y, x)) {
      ans[p1] = 1;
      continue;
    }
    cout << "NO" << endl;
    return 0;
  }
  for (i = 1; i <= n; i++) {
    a[i].ans = ans[GetFather(i)];
  }
  sort(a + 1, a + n + 1, cmp);
  cout << "YES" << endl;
  for (i = 1; i <= n; i++) {
    cout << a[i].ans << " ";
  }
  cout << endl;
  return 0;
}
int GetFather(int pos) {
  int ret, now, next;
  now = pos;
  while (father[now] != now) {
    now = father[now];
  }
  ret = now;
  now = pos;
  while (father[now] != now) {
    next = father[now];
    father[now] = ret;
    now = next;
  }
  return ret;
}
void Line(int p1, int p2) {
  int f1, f2;
  f1 = GetFather(p1);
  f2 = GetFather(p2);
  father[f2] = f1;
}
int Find(int val) {
  node nd;
  int pos;
  nd.val = val;
  pos = lower_bound(a + 1, a + n + 1, nd) - a;
  if (a[pos].val != val)
    return -1;
  else
    return pos;
}
bool check(int val, int flag, int flag2) {
  if (Find(flag - val) == -1) return false;
  bool r1, r2;
  int p1, p2;
  r1 = r2 = true;
  p1 = Find(flag2 - val);
  if (p1 != -1 && !visited[p1]) {
    visited[p1] = true;
    r1 = check(flag2 - val, flag, flag2);
  }
  p2 = Find(flag2 - flag + val);
  if (p2 != -1 && !visited[p2]) {
    visited[p2] = true;
    r2 = check(flag2 - flag + val, flag, flag2);
  }
  if (r1 && r2)
    return true;
  else
    return false;
}
