#include <bits/stdc++.h>
using namespace std;
bool myfunc(pair<int, int> a, pair<int, int> b) {
  return (a.first > b.first) ? 1 : 0;
}
int main() {
  map<int, int> mymap;
  int n;
  int a, b;
  cin >> n;
  cin >> a >> b;
  pair<int, int> arr[n];
  int ans[n];
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    arr[i] = make_pair(k, i);
  }
  for (int i = 0; i < n; i++) {
    ans[i] = -1;
  }
  sort(arr, arr + n, myfunc);
  int j, k;
  j = n - 1;
  k = n - 1;
  for (int i = 0; i < n; i++) {
    if (ans[arr[i].second] == -1) {
      int save1 = -1, save2 = -1;
      int counter_a = a - arr[i].first;
      int counter_b = b - arr[i].first;
      while (arr[j].first < counter_a && j >= 0) {
        j--;
      }
      if (arr[j].first == counter_a && ans[arr[j].second] == -1) save1 = j;
      while (arr[k].first < counter_b && k >= 0) {
        k--;
      }
      if (arr[k].first == counter_b && ans[arr[k].second] == -1) save2 = k;
      if (save1 == -1 && save2 == -1)
        ans[arr[i].second] = -1;
      else if (save1 >= save2) {
        ans[arr[i].second] = 0;
        ans[arr[save1].second] = 0;
      } else if (save2 > save1) {
        ans[arr[i].second] = 1;
        ans[arr[save2].second] = 1;
      }
    }
  }
  bool fail = 0;
  for (int i = 0; i < n; i++)
    if (ans[i] == -1) fail = 1;
  if (fail == 0) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << ans[i] << " ";
    }
  } else {
    cout << "NO" << endl;
  }
}
