#include <bits/stdc++.h>
using namespace std;
int n, a, b, fa[111111], num[111111], huan[111111];
int flag[111111];
map<int, int> N;
int found(int x) {
  if (fa[x] == x)
    return fa[x];
  else
    return fa[x] = found(fa[x]);
}
int main() {
  cin >> n >> a >> b;
  for (int i = 1; i <= n; i++) {
    cin >> num[i];
    fa[i] = i;
    N[num[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    if (N.count(a - num[i])) {
      fa[found(N[a - num[i]])] = found(i);
      flag[i] |= 1;
    }
    if (N.count(b - num[i])) {
      fa[found(N[b - num[i]])] = found(i);
      flag[i] |= 2;
    }
  }
  for (int i = 1; i <= n; i++) {
    huan[i] = 3;
  }
  for (int i = 1; i <= n; i++) {
    huan[found(i)] &= flag[i];
  }
  for (int i = 1; i <= n; i++) {
    if (huan[i] == 0) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  for (int i = 1; i <= n; i++) {
    int xx = huan[found(i)] - 1;
    xx = xx % 2;
    cout << xx << ' ';
  }
  cout << endl;
  return 0;
}
