#include <bits/stdc++.h>
using namespace std;
void move(int &curr, int &next, vector<vector<int>> &adjList) {
  int temp = next;
  if (adjList[next][0] != curr) {
    next = adjList[next][0];
    curr = temp;
  } else {
    next = adjList[next][1];
    curr = temp;
  }
}
int main() {
  int N, A, B;
  cin >> N >> A >> B;
  vector<int> info(N);
  map<int, int> toIndex;
  for (int i = 0; i < N; i++) {
    cin >> info[i];
    toIndex[info[i]] = i;
  }
  bool valid = true;
  vector<vector<int>> adjList(N);
  for (int i = 0; i < N; i++) {
    int next_A = A - info[i];
    if (toIndex.count(next_A)) adjList[i].push_back(toIndex[next_A]);
    int next_B = B - info[i];
    if (next_B != next_A and toIndex.count(next_B))
      adjList[i].push_back(toIndex[next_B]);
    if (adjList[i].size() == 0) valid = false;
  }
  if (!valid) {
    cout << "NO" << endl;
    return 0;
  }
  vector<bool> visited(N);
  vector<int> result(N, -1);
  for (int i = 0; i < N; i++) {
    if (visited[i] == 0 and adjList[i].size() == 1) {
      int curr = i;
      int next = adjList[curr][0];
      while (true) {
        visited[curr] = 1;
        visited[next] = 1;
        int first = info[curr];
        int second = info[next];
        if (A - first == second)
          result[curr] = result[next] = 0;
        else
          result[curr] = result[next] = 1;
        if (adjList[next].size() == 1) break;
        move(curr, next, adjList);
        if (adjList[next].size() == 1) {
          valid = false;
          break;
        }
        move(curr, next, adjList);
      }
    }
  }
  if (!valid) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 0; i < N; i++) {
    if (visited[i] == 0) {
      int curr = i;
      int next = adjList[curr][0];
      while (true) {
        visited[curr] = 1;
        visited[next] = 1;
        int first = info[curr];
        int second = info[next];
        if (A - first == second)
          result[curr] = result[next] = 0;
        else
          result[curr] = result[next] = 1;
        if (adjList[next].size() == 1) break;
        move(curr, next, adjList);
        move(curr, next, adjList);
        if (visited[curr]) break;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < N; i++) {
    printf("%d", result[i]);
    printf(i != N - 1 ? " " : "\n");
  }
}
