#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int p[100001];
map<int, int> q;
map<int, int> ans;
int w[100001];
void dfs(int v, int t) {
  if (q.find(v) == q.end()) return;
  if (ans.find(v) != ans.end()) return;
  if (t) {
    if (q.find(b - v) == q.end()) {
      cout << "NO\n";
      exit(0);
    }
    ans[v] = ans[b - v] = 1;
    dfs(a - b + v, 1);
  } else {
    if (q.find(a - v) == q.end()) {
      cout << "NO\n";
      exit(0);
    }
    ans[v] = ans[a - v] = 0;
    dfs(b - a + v, 0);
  }
}
void go(int v, int t) {
  if (ans.find(v) != ans.end()) {
    if (ans[v] != t) {
      cout << "NO\n";
      exit(0);
    }
  }
  ans[v] = t;
  ans[a - v] = t;
  go(b - a + v, 0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> a >> b;
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
    q[p[i]] = i;
  }
  if (a == b) {
    for (int i = 0; i < n; ++i) {
      if (q.find(a - p[i]) == q.end()) {
        cout << "NO\n";
        return 0;
      }
    }
    cout << "YES\n";
    for (int i = 0; i < n; ++i) cout << "0 ";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    int cnt = 0;
    cnt += q.find(a - p[i]) != q.end();
    cnt += q.find(b - p[i]) != q.end();
    if (cnt == 0) {
      cout << "NO\n";
      return 0;
    }
    if (cnt == 1) {
      if (q.find(a - p[i]) != q.end())
        dfs(p[i], 0);
      else
        dfs(p[i], 1);
    }
  }
  for (int i = 0; i < n; ++i) {
    if (ans.find(p[i]) == ans.end()) {
      go(p[i], 0);
    }
  }
  cout << "YES" << endl;
  for (map<int, int>::iterator it = ans.begin(); it != ans.end(); ++it) {
    w[q[it->first]] = it->second;
  }
  for (int i = 0; i < n; ++i) cout << w[i] << " ";
  cout << endl;
  return 0;
}
