#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, a, b, p[maxn], par[maxn], flag[maxn], team[maxn];
map<int, int> nums;
int find(int x) {
  if (x == par[x]) {
    return par[x];
  } else {
    return par[x] = find(par[x]);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
    nums[p[i]] = i;
    par[i] = i;
  }
  for (int i = 1; i <= n; i++) {
    if (nums.count(a - p[i])) {
      par[find(nums[a - p[i]])] = find(i);
      flag[i] |= 1;
    }
    if (nums.count(b - p[i])) {
      par[find(nums[b - p[i]])] = find(i);
      flag[i] |= 2;
    }
  }
  for (int i = 1; i <= n; i++) {
    team[i] = 3;
  }
  for (int i = 1; i <= n; i++) {
    team[find(i)] &= flag[i];
  }
  for (int i = 1; i <= n; i++) {
    if (team[i] == 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) {
    cout << !(team[find(i)] & 1) << " ";
  }
  cout << endl;
  return 0;
}
