#include <bits/stdc++.h>
using namespace std;
void solve(int n, int a, int b) {
  map<int, int> check;
  int x, total = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    check[x] = 1;
    if (check[a - x]) {
      if (x == a - x)
        total++;
      else
        total += 2;
    }
  }
  if (total == n) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      cout << "0 ";
    }
  } else
    cout << "NO";
  return;
}
int main() {
  int n, a, b, arr[100002], x;
  cin >> n >> a >> b;
  set<int> s;
  map<int, int> check;
  map<int, int> pos;
  map<int, pair<int, int> > match;
  if (a == b) {
    solve(n, a, b);
    return 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    pos[arr[i]] = i;
    x = arr[i];
    check[x] = 1;
    if (check[a - x] == 1) {
      if (match[x].first == 0) {
        match[x].first = a - x;
        s.insert(x);
      } else if (match[x].second == 0) {
        s.erase(x);
        match[x].second = a - x;
      }
      if (x != a - x) {
        if (match[a - x].first == 0) {
          match[a - x].first = x;
          s.insert(a - x);
        } else if (match[a - x].second == 0) {
          s.erase(a - x);
          match[a - x].second = x;
        }
      }
    }
    if (check[b - x] == 1) {
      if (match[x].first == 0) {
        match[x].first = b - x;
        s.insert(x);
      } else if (match[x].second == 0) {
        s.erase(x);
        match[x].second = b - x;
      }
      if (x != b - x) {
        if (match[b - x].first == 0) {
          s.insert(b - x);
          match[b - x].first = x;
        } else if (match[b - x].second == 0) {
          s.erase(b - x);
          match[b - x].second = x;
        }
      }
    }
  }
  map<int, int> ans;
  int total = 0, flag = 0;
  set<int>::iterator it;
  while (!s.empty()) {
    it = s.begin();
    x = (*it);
    if (check[a - x]) {
      ans[pos[x]] = 1;
      ans[pos[a - x]] = 1;
      if (x == a - x)
        total++;
      else
        total += 2;
      s.erase(x);
      if (s.find(a - x) != s.end()) {
        s.erase(a - x);
      } else {
        if (check[b - (a - x)] && check[a - (b - (a - x))]) {
          if (b - a + x != a - x) s.insert(b - a + x);
        } else if (check[b - a + x]) {
          flag = 1;
          break;
        }
      }
      check[x] = 0;
      check[a - x] = 0;
    } else {
      ans[pos[x]] = 2;
      ans[pos[b - x]] = 2;
      if (x == b - x)
        total++;
      else
        total += 2;
      s.erase(x);
      if (s.find(b - x) != s.end()) {
        s.erase(b - x);
      } else {
        if (check[a - (b - x)] && check[b - (a - (b - x))]) {
          if (a - b + x != b - x) s.insert(a - b + x);
        } else if (check[a - b + x]) {
          flag = 1;
          break;
        }
      }
      check[x] = 0;
      check[b - x] = 0;
    }
  }
  if (flag == 1 || total != n) {
    cout << "NO";
  } else {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      cout << ans[i] - 1 << " ";
    }
  }
  return 0;
}
