#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, a, b;
  cin >> n >> a >> b;
  vector<int> p(n);
  for (auto &t : p) {
    cin >> t;
  }
  map<int, int> ind;
  set<int> lp;
  for (int i = 0; i < n; i++) {
    ind[p[i]] = i;
    lp.insert(p[i]);
  }
  set<int> ans_a;
  set<int> ans_b;
  auto can_a = [&](int x) {
    if (a == 2 * x) {
      return true;
    }
    return ans_a.count(a - x) || lp.count(a - x);
  };
  auto can_b = [&](int x) {
    if (b == 2 * x) {
      return true;
    }
    return ans_b.count(b - x) || lp.count(b - x);
  };
  set<pair<int, int>> s;
  vector<int> tk(n);
  vector<int> deg(n);
  auto upd = [&](int i) {
    s.erase({deg[i], i});
    deg[i] = can_a(p[i]) + can_b(p[i]);
    s.insert({deg[i], i});
  };
  for (int i = 0; i < n; i++) {
    upd(i);
  }
  auto ers = [&](int i) {
    tk[i] = 1;
    lp.erase(p[i]);
    if (ind.count(a - p[i]) && !tk[ind[a - p[i]]]) upd(ind[a - p[i]]);
    if (ind.count(b - p[i]) && !tk[ind[b - p[i]]]) upd(ind[b - p[i]]);
  };
  while (!s.empty()) {
    if (s.begin()->first == 0) {
      cout << "NO\n";
      return 0;
    } else {
      int i = s.begin()->second;
      s.erase(s.begin());
      if (can_a(p[i])) {
        ans_a.insert(p[i]);
        ans_a.insert(a - p[i]);
        ers(i);
        if (lp.count(a - p[i])) ers(ind[a - p[i]]);
      } else {
        ans_b.insert(p[i]);
        ans_b.insert(b - p[i]);
        ers(i);
        if (lp.count(b - p[i])) ers(ind[b - p[i]]);
      }
    }
  }
  cout << "YES\n";
  for (auto t : p) {
    cout << (ans_b.count(t)) << ' ';
  }
  cout << '\n';
}
