#include <bits/stdc++.h>
using namespace std;
int a, b;
unordered_map<int, int> s;
int cc[111111];
int p[111111];
bool canA[111111];
bool canB[111111];
void dfs(int v, int c) {
  cc[v] = c;
  int to[2]{a - p[v], b - p[v]};
  for (int i = 0; i < 2; i++) {
    int x = to[i];
    if (s.find(x) != s.end()) {
      int y = s[x];
      if (cc[y] == 0) {
        dfs(y, c);
      }
    }
  }
}
int ans[111111];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%d%d", &a, &b);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i]);
    s[p[i]] = i;
  }
  int c = 0;
  for (int i = 0; i < n; i++) {
    if (cc[i] == 0) {
      dfs(i, ++c);
    }
  }
  memset(canA, true, sizeof(bool) * 111111);
  memset(canB, true, sizeof(bool) * 111111);
  for (int i = 0; i < n; i++) {
    if (s.find(a - p[i]) == s.end()) {
      canA[cc[i]] = false;
    }
    if (s.find(b - p[i]) == s.end()) {
      canB[cc[i]] = false;
    }
  }
  for (int i = 0; i < n; i++) {
    if (canA[cc[i]]) {
      ans[i] = 0;
    } else if (canB[cc[i]]) {
      ans[i] = 1;
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
