#include <bits/stdc++.h>
using namespace std;
int a[100005];
map<int, int> mp;
int par[100005];
int ans[100005];
int root(int x) {
  while (par[x] != x) x = par[x];
  return x;
}
void join(int x, int y) {
  x = root(x);
  y = root(y);
  par[x] = y;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, A, B;
  cin >> n >> A >> B;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mp[a[i]] = i;
  }
  for (int i = 1; i <= n + 2; i++) {
    par[i] = i;
  }
  for (int i = 1; i <= n; i++) {
    if (mp.count(A - a[i])) {
      join(mp[A - a[i]], mp[a[i]]);
    } else {
      join(mp[a[i]], n + 1);
    }
    if (mp.count(B - a[i])) {
      join(mp[B - a[i]], mp[a[i]]);
    } else {
      join(mp[a[i]], n + 2);
    }
  }
  for (int i = 1; i <= n + 2; i++) ans[i] = root(i);
  if (ans[n + 1] == ans[n + 2]) {
    cout << "NO\n";
    return 0;
  }
  cout << "YES\n";
  for (int i = 1; i <= n; i++) {
    if (ans[i] == ans[n + 1])
      cout << "1 ";
    else
      cout << "0 ";
  }
  cout << endl;
  return 0;
}
