#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int c[100001], fa[100001];
int ans[100001];
map<int, int> m;
int getfather(int n) { return fa[n] == n ? n : (fa[n] = getfather(fa[n])); }
int main() {
  scanf("%d%d%d", &n, &a, &b);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &c[i]);
    m[c[i]] = i;
    ans[i] = -1;
  }
  for (int i = 0; i < n; ++i) fa[i] = i;
  for (int i = 0; i < n; ++i) {
    int x = getfather(i);
    if (m.find(a - c[i]) != m.end()) {
      int y = getfather(m[a - c[i]]);
      fa[y] = x;
    }
    if (m.find(b - c[i]) != m.end()) {
      int y = getfather(m[b - c[i]]);
      fa[y] = x;
    }
  }
  for (int i = 0; i < n; ++i)
    if (getfather(i) == i) ans[i] = 0;
  for (int i = 0; i < n; ++i) {
    int x = getfather(i);
    if (m.find(a - c[i]) == m.end()) ans[x] |= 1;
    if (m.find(b - c[i]) == m.end()) ans[x] |= 2;
  }
  bool flag = true;
  for (int i = 0; i < n; ++i)
    if (getfather(i) == i) {
      if (ans[i] == 3) {
        flag = false;
        break;
      } else if (ans[i] == 2)
        ans[i] = 0;
      else
        ans[i] = 1;
    }
  if (!flag)
    printf("NO\n");
  else {
    printf("YES\n");
    printf("%d", ans[getfather(0)]);
    for (int i = 1; i < n; ++i) printf(" %d", ans[getfather(i)]);
  }
  return 0;
}
