#include <bits/stdc++.h>
using namespace std;
int n;
int s[3];
int p[100006];
map<int, int> f;
bool Set(int x, int c) {
  if (f[x]) return f[x] == c;
  f[x] = c;
  return ((f.find(s[c] - x) != f.end() ? Set(s[c] - x, c) : false) &
          (f.find(s[3 - c] - x) != f.end() ? Set(s[3 - c] - x, c) : true));
}
void Clear(int x) {
  if (f.find(x) != f.end() && f[x]) {
    f[x] = 0;
    Clear(s[1] - x);
    Clear(s[2] - x);
  }
}
void EXEC() {
  cin >> n >> s[1] >> s[2];
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
    f[p[i]] = 0;
  }
  for (int i = 0; i < n; ++i)
    if (!f[p[i]]) {
      if (Set(p[i], 1)) continue;
      Clear(p[i]);
      if (Set(p[i], 2)) continue;
      printf("NO\n");
      return;
    }
  printf("YES\n");
  for (int i = 0; i < n; ++i) printf("%d ", f[p[i]] - 1);
  printf("\n");
}
int main() {
  EXEC();
  return 0;
}
