#include <bits/stdc++.h>
using namespace std;
map<int, int> mp, vis, mark, ans;
int deep, last;
vector<int> vec;
int n, a, b;
int arr[100010];
void dfs(int u) {
  vis[u] = ++deep;
  last = u;
  vec.push_back(u);
  int x = a - u;
  if (mp.count(x) && !vis.count(x)) dfs(x);
  x = b - u;
  if (mp.count(x) && !vis.count(x)) dfs(x);
}
void dfs(int u, int f, int uu) {
  mark[u] = 1;
  int x = a - u;
  if (mp.count(x) && !mark.count(x) && x - uu) {
    if (!f) ans[u] = 0, ans[x] = 0;
    dfs(x, f ^ 1, u);
  }
  x = b - u;
  if (mp.count(x) && !mark.count(x) && x - uu) {
    if (!f) ans[u] = ans[x] = 1;
    dfs(x, f ^ 1, u);
  }
}
int main() {
  cin >> n >> a >> b;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", arr + i);
    mp[arr[i]] = 1;
  }
  for (int i = 1; i <= n; ++i) {
    if (!vis.count(arr[i])) {
      last = 0;
      deep = 0;
      vec.clear();
      dfs(arr[i]);
      if (deep % 2 == 0) {
        dfs(last, 0, 0);
      } else {
        int can = 0;
        for (int i = 0; i < vec.size(); ++i) {
          int u = vec[i];
          if (u + u == a) {
            ans[u] = 0;
            int x = b - u;
            mark[u] = 1;
            if (mp.count(x) && x != u) {
              dfs(x, 0, 0);
            }
            can = 1;
            break;
          }
          if (u + u == b) {
            ans[u] = 1;
            int x = a - u;
            mark[u] = 1;
            if (mp.count(x) && x != u) {
              dfs(x, 0, 0);
            }
            can = 1;
            break;
          }
        }
        if (!can) {
          puts("NO");
          return 0;
        }
      }
    }
  }
  puts("YES");
  for (int i = 1; i <= n; ++i) printf("%d ", ans[arr[i]]);
}
