#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[100001];
bool findpair[100001];
vector<int> node[100011];
int source, sink;
int color[100011];
bool dfs(int now, int c) {
  color[now] = c;
  bool ans = true;
  for (int i = 0; i < node[now].size(); i++) {
    if (color[node[now][i]] == -1) {
      ans = (ans && dfs(node[now][i], c));
    } else if (color[node[now][i]] != c) {
      ans = false;
      break;
    }
  }
  return ans;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int n, a, b;
  cin >> n >> a >> b;
  for (int i = 0; i < n; i++) {
    cin >> p[i].first;
    p[i].second = i;
  }
  sort(p, p + n);
  if (a == b) {
    memset(findpair, false, sizeof(findpair));
    bool flag = true;
    for (int i = 0; i < n; i++) {
      if (findpair[i]) continue;
      int t = lower_bound(p, p + n, make_pair(a - p[i].first, 0)) - p;
      if (t >= n) {
        flag = false;
        break;
      }
      if (p[t].first == a - p[i].first) {
        findpair[i] = findpair[t] = true;
      } else {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << "YES" << endl;
      for (int i = 0; i < n; i++) cout << "1 ";
      cout << endl;
    } else
      cout << "NO" << endl;
  } else {
    bool flag = true;
    memset(color, -1, sizeof(color));
    for (int i = 0; i < n; i++) {
      bool hasA = false;
      bool hasB = false;
      int t = lower_bound(p, p + n, make_pair(a - p[i].first, 0)) - p;
      if (t < n && p[t].first == (a - p[i].first)) {
        int tt = p[t].second;
        int ti = p[i].second;
        node[tt].push_back(ti);
        node[ti].push_back(tt);
        hasA = true;
      }
      t = lower_bound(p, p + n, make_pair(b - p[i].first, 0)) - p;
      if (t < n && p[t].first == (b - p[i].first)) {
        int tt = p[t].second;
        int ti = p[i].second;
        node[tt].push_back(ti);
        node[ti].push_back(tt);
        hasB = true;
      }
      if ((!hasA) && (!hasB)) {
        flag = false;
        break;
      } else if (hasA && (!hasB)) {
        color[p[i].second] = 1;
      } else if ((!hasA) && hasB) {
        color[p[i].second] = 0;
      }
    }
    if (!flag) {
      cout << "NO" << endl;
      return 0;
    }
    for (int i = 0; i < n; i++) {
      if (color[i] != -1) {
        if (dfs(i, color[i]) == false) {
          flag = false;
          break;
        }
      }
    }
    if (!flag) {
      cout << "NO" << endl;
      return 0;
    }
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      if (color[i] == 1)
        cout << "0 ";
      else
        cout << "1 ";
    }
  }
  return 0;
}
