#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[100005];
int q[100005];
int ans[100005];
int n, a, b, mxab, miab;
int checkmi(int i) {
  pair<int, int> tmp = make_pair(miab - p[i].first, 1);
  if (*lower_bound(p, p + n, tmp) != tmp) return 0;
  return 1;
}
int checkmx(int i) {
  pair<int, int> tmp = make_pair(mxab - p[i].first, 0);
  if (*lower_bound(p, p + n, tmp) != tmp) return 0;
  return 1;
}
int dfs(int i) {
  p[i].second = 0;
  pair<int, int> tmp = make_pair(miab - p[i].first, 1);
  pair<int, int>* pos = lower_bound(p, p + n, tmp);
  if (*pos == tmp) {
    dfs(pos - p);
  }
  tmp = make_pair(mxab - p[i].first, 1);
  pos = lower_bound(p, p + n, tmp);
  if (*pos == tmp) {
    dfs(pos - p);
  }
}
int main() {
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> p[i].first;
    q[i] = p[i].first;
    p[i].second = 1;
  }
  mxab = max(a, b);
  miab = min(a, b);
  sort(p, p + n);
  p[n].first = 1000000001;
  for (int i = 0; i < n; i++) {
    if (!checkmi(i)) {
      dfs(i);
    }
  }
  for (int i = 0; i < n; i++) {
    if (p[i].second) {
      if (!checkmi(i)) {
        cout << "NO" << endl;
        return 0;
      }
    } else {
      if (!checkmx(i)) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) {
    ans[i] = (p[i].second ^ (b >= a ? 1 : 0));
  }
  for (int i = 0; i < n; i++) {
    pair<int, int> tmp = make_pair(q[i], 1);
    pair<int, int>* pos = lower_bound(p, p + n, tmp);
    if (*pos == tmp) {
      cout << ans[pos - p] << " ";
      continue;
    }
    tmp = make_pair(q[i], 0);
    pos = lower_bound(p, p + n, tmp);
    if (*pos == tmp) {
      cout << ans[pos - p] << " ";
    }
  }
  return 0;
}
