#include <bits/stdc++.h>
using namespace std;
int n, a, b, p[100005];
set<int> e[100005];
int answer[100005];
map<int, int> p2i;
int find(int x) { return p2i.count(x) ? p2i[x] : 0; }
int how(int x, int y) {
  if (a - p[x] == p[y]) return 1;
  if (b - p[x] == p[y]) return 2;
  return 1337;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
    p2i[p[i]] = i;
  }
  if (a == b) {
    for (int i = 1; i <= n; i++) {
      if (!find(a - p[i])) {
        cout << "NO" << endl;
        return 0;
      }
    }
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) cout << 0 << ' ';
    cout << endl;
    return 0;
  }
  deque<int> q;
  for (int i = 1; i <= n; i++) {
    int na = find(a - p[i]);
    int nb = find(b - p[i]);
    if (na) e[i].insert(na);
    if (nb) e[i].insert(nb);
    if (e[i].size() == 0LL) {
      cout << "NO" << endl;
      return 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (e[i].size() == 1LL) q.push_back(i);
    while (q.size()) {
      int at = q.front();
      q.pop_front();
      if (e[at].size() != 1LL) continue;
      if (answer[at]) continue;
      int next = (*e[at].begin());
      if (answer[next]) continue;
      if (at == next) {
        e[at].erase(next);
        answer[at] = how(at, next);
        continue;
      }
      answer[at] = how(at, next);
      answer[next] = how(at, next);
      e[at].erase(next);
      e[next].erase(at);
      for (int after : e[next]) {
        if (after == at) continue;
        if (after == next) continue;
        e[after].erase(next);
        if (e[after].size() == 1LL) q.push_front(after);
      }
      e[next].clear();
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!answer[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    cout << (answer[i] - 1) << ' ';
  }
  cout << endl;
}
