#include <bits/stdc++.h>
using namespace std;
int n, sa, sb;
const int N = 400000;
int arr[N];
set<int> nums, a, b;
int acompl(int x) { return sa - x; }
int bcompl(int x) { return sb - x; }
vector<set<int> > groups;
void add(int x) {
  if (!nums.count(x)) return;
  (groups.end() - 1)->insert(x);
  nums.erase(nums.find(x));
  add(acompl(x));
  add(bcompl(x));
}
bool test(set<int> &target, int ss) {
  for (set<int>::iterator i = target.begin(); i != target.end(); ++i) {
    if (!target.count(ss - *i)) return false;
  }
  return true;
}
bool accept(set<int> &target, set<int> &container) {
  for (set<int>::iterator i = target.begin(); i != target.end(); ++i) {
    container.insert(*i);
  }
}
void fail() {
  printf("NO\n");
  exit(0);
}
const bool D = 0;
int main() {
  if (D) {
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout);
  } else {
  }
  scanf("%d%d%d", &n, &sa, &sb);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &arr[i]);
    nums.insert(arr[i]);
  }
  for (int i = 0; i < n; ++i) {
    int x = arr[i];
    groups.push_back(set<int>());
    add(x);
  }
  for (int i = 0; i < groups.size(); ++i) {
    bool at, bt;
    at = test(groups[i], sa);
    bt = test(groups[i], sb);
    if (at) {
      accept(groups[i], a);
    } else if (bt) {
      accept(groups[i], b);
    } else {
      fail();
    }
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) {
    printf("%d ", b.count(arr[i]));
  }
  return 0;
}
