#include <bits/stdc++.h>
using namespace std;
int test;
int n, a, b;
int t[200007];
map<int, int> m;
map<int, int> nr;
vector<int> g[200007], G[200007];
bitset<200007> czy;
stack<int> s;
int w[200007];
void dfs(int v) {
  czy[v] = 1;
  for (int i = 0; i < (G[v].size()); ++i) {
    int u = G[v][i];
    if (!czy[u]) dfs(u);
  }
  s.push(v);
  return;
}
void ustaw(int v) {
  czy[v] = 1;
  w[v] = (w[v ^ 1] == -1);
  for (int i = 0; i < (g[v].size()); ++i) {
    int u = g[v][i];
    if (!czy[u]) {
      ustaw(u);
    }
  }
  return;
}
void solve() {
  cin >> n >> a >> b;
  for (int i = 0; i < (n); ++i) {
    cin >> t[i];
    nr[t[i]] = i;
    m[t[i]] = 1;
  }
  for (int i = 0; i < (n); ++i) {
    if (!m[a - t[i]] && !m[b - t[i]]) {
      cout << "NO";
      return;
    }
  }
  for (int i = 0; i < (n); ++i) {
    if (m[a - t[i]] && m[b - t[i]]) {
      g[i * 2].push_back(nr[b - t[i]] * 2);
      G[nr[b - t[i]] * 2].push_back(i * 2);
      g[i * 2].push_back(nr[a - t[i]] * 2);
      G[nr[a - t[i]] * 2].push_back(i * 2);
      g[i * 2 ^ 1].push_back(nr[a - t[i]] * 2 ^ 1);
      g[i * 2 ^ 1].push_back(nr[b - t[i]] * 2 ^ 1);
      G[nr[b - t[i]] * 2 ^ 1].push_back(i * 2 ^ 1);
      G[nr[a - t[i]] * 2 ^ 1].push_back(i * 2 ^ 1);
      continue;
    }
    if (m[a - t[i]]) {
      g[i * 2 ^ 1].push_back(nr[a - t[i]] * 2 ^ 1);
      G[nr[a - t[i]] * 2 ^ 1].push_back(i * 2 ^ 1);
      g[i * 2].push_back(i * 2 ^ 1);
      G[i * 2 ^ 1].push_back(i * 2);
    }
    if (m[b - t[i]]) {
      g[i * 2].push_back(nr[b - t[i]] * 2);
      G[nr[b - t[i]] * 2].push_back(i * 2);
      g[i * 2 ^ 1].push_back(i * 2);
      G[i * 2].push_back(i * 2 ^ 1);
    }
  }
  for (int i = 0; i < (2 * n); ++i) {
    if (!czy[i]) dfs(i);
  }
  for (int i = 0; i < (2 * n); ++i) {
    w[i] = -1;
    czy[i] = 0;
  }
  while (!s.empty()) {
    int v = s.top();
    s.pop();
    if (!czy[v]) ustaw(v);
  }
  for (int i = 0; i < (2 * n); ++i) {
    for (int j = 0; j < (g[i].size()); ++j) {
      if (w[i] && !w[g[i][j]]) {
        cout << "NO";
        return;
      }
    }
  }
  cout << "YES" << '\n';
  for (int i = 0; i < (n); ++i) {
    cout << w[i * 2] << " ";
  }
  return;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  test = 1;
  while (test--) solve();
  return 0;
}
