#include <bits/stdc++.h>
using namespace std;
vector<int> as, bs;
map<int, int> vm;
int n, a, b;
map<int, stack<int> > misi;
void del(map<int, int>::iterator it) {
  if (!(--it->second)) {
    vm.erase(it);
  }
}
void take_to_a(int x) {
  map<int, int>::iterator it_x = vm.find(x);
  del(it_x);
  as.push_back(x);
  if (x != a - x) {
    map<int, int>::iterator it_amx = vm.find(a - x);
    del(it_amx);
    as.push_back(a - x);
  }
}
void take_to_b(int x) {
  map<int, int>::iterator it_x = vm.find(x);
  del(it_x);
  bs.push_back(x);
  if (x != b - x) {
    map<int, int>::iterator it_amx = vm.find(b - x);
    del(it_amx);
    bs.push_back(b - x);
  }
}
bool solve() {
  cin >> n >> a >> b;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &v[i]);
    misi[v[i]].push(i);
  }
  for (int i = 0; i < n; ++i) {
    ++vm[v[i]];
  }
  map<int, int>::iterator start = vm.begin(), finish = --vm.end();
  int loaded_count = 0;
  while (vm.size() > 0) {
    int min_value = vm.begin()->first;
    int max_value = (--vm.end())->first;
    if (a - min_value > max_value) {
      map<int, int>::iterator it_find = vm.find(b - min_value);
      if (it_find == vm.end()) {
        return false;
      } else {
        take_to_b(min_value);
      }
      continue;
    }
    if (a - min_value == max_value) {
      take_to_a(min_value);
      continue;
    }
    if (b - min_value > max_value) {
      map<int, int>::iterator it_find = vm.find(a - min_value);
      if (it_find == vm.end()) {
        return false;
      } else {
        take_to_a(min_value);
      }
      continue;
    }
    if (b - min_value == max_value) {
      take_to_b(min_value);
      continue;
    }
    return false;
  }
}
int main() {
  bool ans = solve();
  if (!ans) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    vector<int> ans(n);
    for (int i = 0; i < bs.size(); ++i) {
      int index = misi[bs[i]].top();
      ans[index] = 1;
      misi[bs[i]].pop();
    }
    for (int i = 0; i < ans.size(); ++i) {
      printf("%d ", ans[i]);
    }
  }
  return 0;
}
