#include <bits/stdc++.h>
const int INF = 1E9;
const double phi = acos(1);
const double EPS = 1E-15;
using namespace std;
int main() {
  int n, a[2];
  scanf("%d %d %d", &n, &a[0], &a[1]);
  pair<int, int> bil[n];
  int solve[n];
  for (int k = 0; k < n; k++) {
    scanf("%d", &bil[k].first);
    solve[k] = bil[k].first;
  }
  sort(solve, solve + n);
  for (int k = 0; k < n; k++) {
    int left = 0, right = n - 1;
    while (left <= right) {
      int mid = (left + right) / 2;
      if (solve[mid] < bil[k].first)
        left = mid + 1;
      else
        right = mid - 1;
    }
    bil[k].second = left;
  }
  int flag[n];
  memset(flag, -1, sizeof(flag));
  bool bisa = 1;
  for (int k = 0; k < n; k++) {
    if (flag[k] < 0) {
      bool testing[2] = {1, 1};
      queue<int> bfs;
      int tanda[n];
      memset(tanda, 0, sizeof(tanda));
      bfs.push(k);
      tanda[k] = 1;
      queue<int> track;
      track.push(k);
      while (!bfs.empty()) {
        int now = bfs.front();
        bfs.pop();
        for (int l = 0; l < 2; l++) {
          int next = a[l] - solve[now];
          int left = 0, right = n - 1;
          while (left <= right) {
            int mid = (left + right) / 2;
            if (solve[mid] < next)
              left = mid + 1;
            else
              right = mid - 1;
          }
          if (left >= 0 && left < n) {
            if (solve[left] == next) {
              if (!tanda[left]) {
                bfs.push(left);
                track.push(left);
                tanda[left] = 1;
              }
            } else {
              testing[l] = 0;
            }
          } else
            testing[l] = 0;
        }
      }
      int buat = testing[0] + testing[1];
      if (testing[1]) buat++;
      if (!buat) {
        printf("NO\n");
        return 0;
      }
      while (!track.empty()) {
        int now = track.front();
        track.pop();
        flag[now] = buat;
      }
    }
  }
  printf("YES\n");
  for (int k = 0; k < n; k++) {
    int ret;
    int tmp = flag[bil[k].second];
    if (tmp == 1) ret = 0;
    if (tmp == 2) ret = 1;
    if (tmp == 3) ret = 0;
    if (k != 0) {
      printf(" ");
    }
    printf("%d", ret);
  }
  printf("\n");
  return 0;
}
