#include <bits/stdc++.h>
using namespace std;
int n;
long long a, b;
vector<long long> p;
map<long long, long long> mp;
void dfs(int v) {
  if (mp[v] == a) {
    mp[v] = b;
    if (mp[a - v] == a) {
      dfs(a - v);
    }
  }
  if (mp[b - v] == -1 || mp[b - v] == b) {
    mp[b - v] = b;
    return;
  } else if (!mp[b - v]) {
    printf("NO");
    exit(0);
  } else {
    dfs(b - v);
  }
}
int main(int argc, char *argv[]) {
  scanf("%d%lld%lld", &n, &a, &b);
  p.resize(n);
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &p[i]);
    mp[p[i]] = -1;
  }
  for (int i = 0; i < n; ++i) {
    if (mp[p[i]] == -1) {
      mp[p[i]] = a;
      if (mp[a - p[i]] == -1 || mp[a - p[i]] == a) {
        mp[a - p[i]] = a;
      } else {
        mp[p[i]] = b;
        if (mp[b - p[i]] == -1 || mp[b - p[i]] == b) {
          mp[b - p[i]] = b;
        } else if (!mp[b - p[i]]) {
          printf("NO");
          exit(0);
        } else {
          dfs(b - p[i]);
        }
      }
    }
  }
  printf("YES\n");
  for (int i = 0; i < n; ++i) {
    if (mp[p[i]] == a) {
      printf("0 ");
    } else {
      printf("1 ");
    }
  }
  return 0;
}
