#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const double PI = atan(1.0) * 4;
const int inf = ~0u >> 1;
const int Dx[] = {1, 0, -1, 0}, Dy[] = {0, 1, 0, -1};
template <class T>
bool chmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool chmax(T& a, const T& b) {
  return b > a ? a = b, 1 : 0;
}
template <class T>
int sgn(T first) {
  return (first > eps) - (first < -eps);
}
const int maxn = int(1e5) + 9;
map<int, int> has;
set<int> A, B;
vector<int> vec[maxn];
int a, b;
int c[maxn], p[maxn], f[maxn];
int find(int first) {
  return first == f[first] ? f[first] : f[first] = find(f[first]);
}
void merge(int first, int second) {
  int t1 = find(first), t2 = find(second);
  if (t1 != t2) f[t1] = t2;
}
bool dfs(int first, int col) {
  set<int> t;
  for (auto v : vec[first]) t.insert(p[v]);
  for (auto v : t) {
    int tmp = col ? b - v : a - v;
    if (t.find(tmp) == t.end()) return 0;
  }
  return 1;
}
int main() {
  int n;
  while (cin >> n >> a >> b) {
    for (int i = (0); i <= (int)(n - 1); i++) {
      scanf("%d", p + i);
      has[p[i]] = i;
    }
    for (int i = (0); i <= (int)(n - 1); i++) f[i] = i;
    for (int i = (0); i <= (int)(n - 1); i++) {
      auto it = has.find(a - p[i]);
      if (it != has.end()) {
        merge(it->second, i);
      }
      it = has.find(b - p[i]);
      if (it != has.end()) {
        merge(it->second, i);
      }
    }
    for (int i = (0); i <= (int)(n - 1); i++) vec[i].clear();
    for (int i = (0); i <= (int)(n - 1); i++) vec[find(i)].push_back(i);
    bool ans = 1;
    memset(c, -1, sizeof(c));
    for (int i = (0); i <= (int)(n - 1); i++)
      if (((int)(vec[i]).size())) {
        if (dfs(i, 0)) {
        } else if (dfs(i, 1)) {
          for (auto v : vec[i]) B.insert(p[v]);
        } else {
          ans = 0;
          break;
        }
      }
    if (!ans)
      puts("NO");
    else {
      for (int i = (0); i <= (int)(n - 1); i++)
        c[i] = (B.find(p[i]) != B.end());
      puts("YES");
      for (int i = (0); i <= (int)(n - 1); i++) {
        printf("%d%c", c[i], " \n"[i == n - 1]);
      }
    }
    has.clear();
  }
  return 0;
}
