#include <bits/stdc++.h>
using namespace std;
map<int, int> cnt[3];
vector<int> A;
vector<pair<int, int> > moved;
int N, a[2], i, x;
void Undo() {
  for (int i = 0; i < moved.size(); i++) {
    cnt[moved[i].first][moved[i].second]--;
    cnt[2][moved[i].second]++;
  }
}
int Try(int s, int x) {
  cnt[2][x]--;
  cnt[s][x]++;
  moved.push_back(make_pair(s, x));
  int y = a[s] - x;
  if (cnt[s][y] == 0 && (cnt[2][y] == 0 || !Try(s, y))) return 0;
  y = a[1 - s] - x;
  if (cnt[2][y] > 0 && cnt[2][x] == 0 && !Try(s, y)) return 0;
  return 1;
}
int main() {
  scanf("%d %d %d", &N, &a[0], &a[1]);
  for (i = 0; i < N; i++) {
    scanf("%d", &x);
    cnt[2][x]++;
    A.push_back(x);
  }
  for (i = 0; i < N; i++)
    if (cnt[2][A[i]] > 0) {
      moved.clear();
      if (!Try(0, A[i])) {
        Undo();
        if (!Try(1, A[i])) {
          printf("NO\n");
          return 0;
        }
      }
    }
  printf("YES\n");
  for (i = 0; i < N; i++) {
    if (cnt[0][A[i]] > 0) {
      printf("0 ");
      cnt[0][A[i]]--;
    } else {
      printf("1 ");
      cnt[1][A[i]]--;
    }
  }
  printf("\n");
  return 0;
}
