#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e5 + 7;
const int Max = 5e2 + 7;
const int Mod = 1e9 + 7;
long long n, a, b, p[Maxn], bit[Maxn];
map<long long, long long> pos;
bool mark[Maxn], can;
vector<long long> V[Maxn];
void get() {
  cin >> n >> a >> b;
  for (long long i = 1; i <= n; i++) cin >> p[i], pos[p[i]] = i;
}
void edge() {
  for (long long i = 1; i <= n; i++) {
    long long x = max(a - p[i], 0ll);
    long long y = max(b - p[i], 0ll);
    x = pos[x], y = pos[y];
    V[i].push_back(x), V[i].push_back(y);
    if (!x && !y) {
      cout << "NO" << endl;
      exit(0);
    }
  }
}
void go(long long u) {
  mark[u] = true;
  for (long long i = 0; i < 2; i++)
    if (!mark[V[u][i]] && V[u][i] && !bit[u])
      bit[u] = i + 1, bit[V[u][i]] = i + 1, go(V[u][i]);
    else if (!mark[V[u][i]] && V[u][i])
      go(V[u][i]);
}
void dfs(long long u, long long T) {
  long long ted = 0, po;
  for (long long i = 0; i < 2; i++)
    if (V[u][i] && !mark[V[u][i]]) ted++, po = i;
  if (!ted) {
    cout << "NO" << endl;
    exit(0);
  }
  if (ted & 1)
    go(u);
  else if (T)
    go(u);
}
void Solve() {
  for (long long i = 1; i <= n; i++)
    if (!mark[i]) dfs(i, 0);
  for (long long i = 1; i <= n; i++)
    if (!mark[i]) dfs(i, 1);
  for (long long i = 1; i <= n; i++)
    if (!bit[i])
      if (p[i] == a - p[i])
        bit[i] = 1;
      else if (p[i] == b - p[i])
        bit[i] = 2;
      else {
        cout << "NO" << endl;
        exit(0);
      }
}
void print() {
  cout << "YES" << endl;
  for (long long i = 1; i <= n; i++) cout << bit[i] - 1 << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  get();
  edge();
  Solve();
  print();
}
