#include <bits/stdc++.h>
using namespace std;
map<int, int> M;
set<int> S;
set<int>::iterator site;
map<int, int>::iterator ite;
int C[100005], N, used[100005];
int update[100005];
int main() {
  int i, j, k, a, b;
  while (scanf("%d%d%d", &N, &a, &b) != EOF) {
    M.clear();
    memset(used, -1, sizeof used);
    for (i = 0; i < N; i++) {
      scanf("%d", &C[i]);
      M[C[i]] = i;
    }
    bool flag = true;
    for (i = 0; i < N && flag; i++) {
      if (used[i] != -1) continue;
      ite = M.find(a - C[i]);
      flag = false;
      if (ite != M.end()) {
        flag = true;
        if (used[ite->second] == -1 || used[ite->second] == 0) {
          used[i] = used[ite->second] = 0;
        } else {
          int x = ite->second;
          int tail = 0;
          S.insert(i);
          while (flag && S.count(x) == 0) {
            if (used[x] != 1) {
              used[x] = 0;
              break;
            }
            S.insert(x);
            ite = M.find(b - C[x]);
            S.insert(ite->second);
            int nx = ite->second;
            ite = M.find(a - C[nx]);
            if (ite == M.end())
              flag = false;
            else
              x = ite->second;
          }
          if (flag)
            for (site = S.begin(); site != S.end(); ++site) {
              used[*site] = 0;
            }
          S.clear();
        }
      }
      if (!flag) ite = M.find(b - C[i]);
      if (!flag && ite != M.end()) {
        flag = true;
        int x = ite->second;
        if (used[x] == -1 || used[x] == 1) {
          used[i] = 1;
          used[x] = 1;
        } else {
          int tail = 0;
          S.insert(i);
          while (flag && S.count(x) == 0) {
            if (used[x] != 0) {
              used[x] = 1;
              break;
            }
            S.insert(x);
            ite = M.find(a - C[x]);
            int nx = ite->second;
            S.insert(nx);
            ite = M.find(b - C[nx]);
            if (ite == M.end())
              flag = false;
            else
              x = ite->second;
          }
          if (flag) {
            for (site = S.begin(); site != S.end(); ++site) {
              used[*site] = 1;
            }
          }
          S.clear();
        }
      }
    }
    if (!flag)
      puts("NO");
    else {
      puts("YES");
      for (i = 0; i < N; i++) {
        printf("%d%c", used[i], i == N - 1 ? '\n' : ' ');
      }
    }
  }
  return 0;
}
