#include <bits/stdc++.h>
using namespace std;
void read(int a = 0) {
  freopen("in", "r", stdin);
  if (a) freopen("out", "w", stdout);
}
struct dsu {
  vector<int> rank, p;
  dsu(int n) {
    rank.assign(n, 0);
    for (int i = 0; i < n; i++) p.push_back(i);
  }
  int get(int i) { return p[i] == i ? i : p[i] = get(p[i]); }
  bool issame(int i, int j) { return get(i) == get(j); }
  void union_sets(int i, int j) {
    int n = get(i);
    int m = get(j);
    if (n != m) {
      if (rank[n] > rank[m]) {
        p[m] = n;
      } else {
        p[n] = m;
        if (rank[m]) rank[m] += (rank[n] == rank[m]);
      }
    }
  }
};
map<int, int> vis;
int ar[100009], pass[100009];
int n, a, b;
int haveto[100009];
int neg(int a) { return a == 1 ? 2 : 1; }
int main() {
  cin >> n >> a >> b;
  dsu tree(n + 1);
  for (int i = 0; i < n; i++) cin >> ar[i], vis[ar[i]] = 1 + i;
  if (a == b) {
    bool done = 1;
    for (int i = 0; i < n; i++)
      if (!vis[a - ar[i]]) done = 0;
    if (done) {
      cout << "YES\n";
      for (int i = 0; i < n; i++) cout << 0 << " ";
      return 0;
    } else
      return cout << "NO", 0;
  }
  bool done = 1;
  for (int i = 0; i < n; i++) {
    if (pass[i]) continue;
    int u = a - ar[i];
    int v = b - ar[i];
    if (vis[u] && vis[v]) {
      int tmp1 = tree.get(i);
      int tmp2 = tree.get(vis[u] - 1);
      int tmp3 = tree.get(vis[v] - 1);
      int h1 = haveto[tmp1];
      int h2 = haveto[tmp2];
      int h3 = haveto[tmp3];
      if ((h1 && h2 && h1 != h2) || (h1 && h3 && h1 != h3) ||
          (h3 && h2 && h3 != h2))
        done = 0;
      int tar = max(h1, max(h2, h3));
      tree.union_sets(i, tmp2);
      tree.union_sets(i, tmp3);
      haveto[tree.get(i)] = tar;
    } else if (vis[u]) {
      int tmp1 = tree.get(i);
      int tmp2 = tree.get(vis[u] - 1);
      int h1 = haveto[tmp1];
      int h2 = haveto[tmp2];
      int tar = (ar[i] + u == a ? 1 : 2);
      if (h1 == neg(tar) || h2 == neg(tar)) done = 0;
      tree.union_sets(i, tmp2);
      haveto[tree.get(i)] = tar;
    } else if (vis[v]) {
      int tmp1 = tree.get(i);
      int tmp2 = tree.get(vis[v] - 1);
      int h1 = haveto[tmp1];
      int h2 = haveto[tmp2];
      int tar = (ar[i] + v == a ? 1 : 2);
      if (h1 == neg(tar) || h2 == neg(tar)) done = 0;
      tree.union_sets(i, tmp2);
      haveto[tree.get(i)] = tar;
    } else
      done = 0;
  }
  if (!done) {
    cout << "NO";
  } else {
    cout << "YES\n";
    for (int i = 0; i < n; i++) cout << haveto[tree.get(i)] - 1 << " ";
  }
}
