#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int p[100000];
int g[100000];
map<int, int> num2index;
set<int> qa, qb, q2;
int main() {
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    num2index[p[i]] = i;
    g[i] = -1;
  }
  if (a == b) {
    for (int i = 0; i < n; i++)
      if (num2index.find(a - p[i]) == num2index.end()) {
        cout << "NO" << endl;
        return 0;
      }
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) cout << "0 ";
    cout << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (num2index.find(a - p[i]) == num2index.end() &&
        num2index.find(b - p[i]) == num2index.end()) {
      cout << "NO" << endl;
      return 0;
    }
    if (num2index.find(a - p[i]) != num2index.end() &&
        num2index.find(b - p[i]) != num2index.end())
      q2.insert(p[i]);
    else if (num2index.find(a - p[i]) != num2index.end())
      qa.insert(p[i]);
    else
      qb.insert(p[i]);
  }
  while (!qa.empty() || !qb.empty()) {
    while (!qa.empty()) {
      int num = *(qa.begin());
      qa.erase(qa.begin());
      g[num2index[num]] = 0;
      if (num != a - num) {
        num = a - num;
        if (qa.find(num) != qa.end()) {
          qa.erase(qa.find(num));
          g[num2index[num]] = 0;
        } else {
          q2.erase(num);
          g[num2index[num]] = 0;
          if (num != b - num) {
            num = b - num;
            if (qb.find(num) != qb.end()) {
              cout << "NO" << endl;
              return 0;
            }
            q2.erase(num);
            qa.insert(num);
          }
        }
      }
    }
    while (!qb.empty()) {
      int num = *(qb.begin());
      qb.erase(qb.begin());
      g[num2index[num]] = 1;
      if (num != b - num) {
        num = b - num;
        if (qb.find(num) != qb.end()) {
          qb.erase(qb.find(num));
          g[num2index[num]] = 1;
        } else {
          q2.erase(num);
          g[num2index[num]] = 1;
          if (num != a - num) {
            num = a - num;
            if (qa.find(num) != qa.end()) {
              cout << "NO" << endl;
              return 0;
            }
            q2.erase(num);
            qb.insert(num);
          }
        }
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; i++) cout << (g[i] == -1 ? 0 : g[i]) << " ";
  cout << endl;
  return 0;
}
