#include <bits/stdc++.h>
using namespace std;
struct SCC {
  int V;
  vector<vector<int>> adj;
  vector<int> discovery, low_link;
  int index;
  int S;
  vector<int> stack;
  vector<bool> on_stack;
  vector<vector<int>> components;
  vector<int> which_component;
  SCC(int v = 0) {
    if (v > 0) init(v);
  }
  SCC(const vector<vector<int>> &_adj) { init(_adj); }
  void init(int v) {
    V = v;
    adj.assign(V, vector<int>());
  }
  void init(const vector<vector<int>> &_adj) {
    adj = _adj;
    V = adj.size();
  }
  void add_edge(int a, int b) { adj[a].push_back(b); }
  void dfs(int node) {
    discovery[node] = low_link[node] = index++;
    stack[S++] = node;
    on_stack[node] = true;
    for (int neighbor : adj[node])
      if (discovery[neighbor] == -1) {
        dfs(neighbor);
        low_link[node] = min(low_link[node], low_link[neighbor]);
      } else if (on_stack[neighbor]) {
        low_link[node] = min(low_link[node], discovery[neighbor]);
      }
    if (low_link[node] == discovery[node]) {
      components.emplace_back();
      vector<int> &component = components.back();
      int x;
      do {
        x = stack[--S];
        on_stack[x] = false;
        component.push_back(x);
        which_component[x] = components.size() - 1;
      } while (x != node);
    }
  }
  void build() {
    discovery.assign(V, -1);
    low_link.assign(V, -1);
    which_component.assign(V, -1);
    S = 0;
    stack.resize(V);
    on_stack.assign(V, false);
    index = 0;
    components.clear();
    for (int i = 0; i < V; i++)
      if (discovery[i] == -1) dfs(i);
  }
};
struct two_sat {
  int n;
  vector<vector<int>> adj;
  vector<bool> assignment;
  two_sat(int _n = 0) { init(_n); }
  void init(int _n) {
    n = _n;
    adj.assign(2 * n, vector<int>());
  }
  int flip(int index) { return index ^ 1; }
  int new_var() {
    adj.emplace_back();
    adj.emplace_back();
    n++;
    return 2 * n - 2;
  }
  void implies(int a, int b) {
    adj[a].push_back(b);
    adj[flip(b)].push_back(flip(a));
  }
  void either(int a, int b) {
    adj[flip(a)].push_back(b);
    adj[flip(b)].push_back(a);
  }
  void set_value(int a) { adj[flip(a)].push_back(a); }
  void at_most_one(const vector<int> &vars) {
    int s = vars.size();
    if (s <= 8) {
      for (int i = 0; i < s; i++)
        for (int j = i + 1; j < s; j++) either(flip(vars[i]), flip(vars[j]));
      return;
    }
    int aux = -1;
    for (int i = 0; i < s - 1; i++) {
      int prev_aux = aux;
      aux = new_var();
      implies(vars[i], aux);
      if (i > 0) {
        implies(prev_aux, aux);
        implies(prev_aux, flip(vars[i]));
      }
    }
    implies(aux, vars[s - 1]);
  }
  bool solve() {
    SCC scc(adj);
    scc.build();
    for (int i = 0; i < n; i++)
      if (scc.which_component[2 * i] == scc.which_component[2 * i + 1])
        return false;
    assignment.resize(n);
    vector<bool> done(n, false);
    for (vector<int> &component : scc.components)
      for (int x : component)
        if (!done[x / 2]) {
          done[x / 2] = true;
          assignment[x / 2] = x % 2 == 0;
        }
    return true;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, A, B;
  cin >> N >> A >> B;
  vector<int> numbers(N);
  map<int, int> num_to_index;
  for (int i = 0; i < N; i++) {
    cin >> numbers[i];
    num_to_index[numbers[i]] = i;
  }
  two_sat solver;
  vector<int> vars(N);
  for (int i = 0; i < N; i++) vars[i] = solver.new_var();
  for (int i = 0; i < N; i++) {
    int x = numbers[i];
    if (num_to_index.count(A - x))
      solver.implies(vars[i], vars[num_to_index[A - x]]);
    else
      solver.set_value(solver.flip(vars[i]));
    if (num_to_index.count(B - x))
      solver.implies(solver.flip(vars[i]),
                     solver.flip(vars[num_to_index[B - x]]));
    else
      solver.set_value(vars[i]);
  }
  if (!solver.solve()) {
    cout << "NO" << '\n';
    return 0;
  }
  cout << "YES" << '\n';
  for (int i = 0; i < N; i++)
    cout << (solver.assignment[i] ? '0' : '1') << (i < N - 1 ? ' ' : '\n');
}
