#include <bits/stdc++.h>
using namespace std;
class TwoSAT {
 public:
  int n;
  vector<vector<int> > g, gt;
  vector<bool> used;
  vector<int> order, comp;
  void dfs1(int v) {
    used[v] = true;
    for (size_t i = 0; i < g[v].size(); ++i) {
      int to = g[v][i];
      if (!used[to]) dfs1(to);
    }
    order.push_back(v);
  }
  void dfs2(int v, int cl) {
    comp[v] = cl;
    for (size_t i = 0; i < gt[v].size(); ++i) {
      int to = gt[v][i];
      if (comp[to] == -1) dfs2(to, cl);
    }
  }
  bool Satisfiable(vector<int> &sol) {
    sol.resize(n / 2);
    sol.clear();
    for (int i = 0; i < n; i++)
      if (!used[i]) dfs1(i);
    for (int i = 0, j = 0; i < n; ++i) {
      int v = order[n - i - 1];
      if (comp[v] == -1) dfs2(v, j++);
    }
    for (int i = 0; i < n; i++)
      if (comp[i] == comp[i ^ 1]) return 0;
    for (int i = 0; i < n; i += 2) {
      int ans = comp[i] > comp[i ^ 1] ? i : i ^ 1;
      sol.push_back(ans % 2);
    }
    return 1;
  }
  void init(int N) {
    n = N * 2;
    used.clear();
    order.clear();
    comp.clear();
    g.resize(n);
    gt.resize(n);
    used.assign(n, false);
    comp.assign(n, -1);
  }
  void imply(int a, int na, int b, int nb) {
    a--;
    b--;
    a *= 2, b *= 2;
    a += na, b += nb;
    g[a].push_back(b);
    gt[b].push_back(a);
    g[b ^ 1].push_back(a ^ 1);
    gt[a ^ 1].push_back(b ^ 1);
  }
};
int n, A, B;
map<long long, int> ma;
long long a[100005];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> A >> B;
  for (int i = 1; i <= n; i++) cin >> a[i];
  set<long long> se;
  for (int i = 1; i <= n; i++) {
    se.insert(a[i]);
  }
  int cnt = 1;
  for (auto it : se) {
    ma[it] = cnt++;
  }
  TwoSAT G;
  G.init(n + 3);
  for (auto it : se) {
    if (se.find(A - it) == se.end() && se.find(B - it) == se.end()) {
      cout << "NO" << endl;
      return 0;
    }
    if (se.find(A - it) != se.end()) {
      int x = ma[it];
      int y = ma[A - it];
      G.imply(x, 1, y, 1);
    } else {
      int x = ma[it];
      G.imply(x, 1, n + 1, 0);
      G.imply(n + 1, 0, x, 0);
    }
    if (se.find(B - it) != se.end()) {
      int x = ma[it];
      int y = ma[B - it];
      G.imply(x, 0, y, 0);
    } else {
      int x = ma[it];
      G.imply(x, 0, n + 2, 1);
      G.imply(n + 2, 1, x, 1);
    }
  }
  vector<int> v;
  bool bla = G.Satisfiable(v);
  if (!bla)
    cout << "NO" << endl;
  else {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      int x = ma[a[i]];
      cout << (!v[x - 1]) << " ";
    }
  }
  return 0;
}
