#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
long long int dx[] = {0, 0, 1, -1};
long long int dy[] = {1, -1, 0, 0};
long long int m = 0, n, res, k, ans = 0, nbcycle = 0;
string s2 = "zero", ch = "", s, t, s1 = "";
set<long long int> st;
vector<pair<string, long long int> > vm;
vector<pair<long long int, pair<long long int, long long int> > > vvv;
vector<pair<long long int, long long int> > vv, vv1;
vector<long long int> v;
long long int p[200005];
map<long long int, long long int> parent, dpA, dpB;
long long int find_set(long long int x) {
  if (parent[x] == x) return x;
  return (parent[x] = find_set(parent[x]));
}
void merge(long long int x, long long int y) {
  y = find_set(y);
  x = find_set(x);
  parent[x] = y;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long int i = 0, x, z, y, j = 0, q, mm = 0, mx = -1e9, idx = 0, ok = 0,
                l = 0, r = 0, negatif = 0, positif = 0, l1, r1, d;
  set<long long int>::iterator it, it1;
  long long int a, b;
  cin >> n >> a >> b;
  for (i = 1; i <= n; i++) {
    cin >> p[i];
    st.insert(p[i]);
    parent[p[i]] = p[i];
  }
  for (i = 1; i <= n; i++) {
    x = a - p[i];
    y = b - p[i];
    if (st.count(x)) {
      merge(p[i], x);
    }
    if (st.count(y)) {
      merge(p[i], y);
    }
    if (!st.count(x) && !st.count(y)) return cout << "NO", 0;
  }
  for (i = 1; i <= n; i++) {
    x = a - p[i];
    y = b - p[i];
    if (st.count(x) && !st.count(y)) {
      dpA[find_set(p[i])] = 1;
    } else if (st.count(y) && !st.count(x)) {
      dpB[find_set(p[i])] = 1;
    }
  }
  for (i = 1; i <= n; i++) {
    if (dpA[find_set(p[i])] && dpB[find_set(p[i])]) return cout << "NO", 0;
  }
  cout << "YES\n";
  for (i = 1; i <= n; i++) {
    if (dpA[find_set(p[i])])
      cout << "0 ";
    else if (dpB[find_set(p[i])])
      cout << "1 ";
    else
      cout << "0 ";
  }
  return 0;
}
