#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
int i, j, q1, q2, m, q, ans, n, h, k, l, f[100500], a, b, v[100500][2],
    d[100500], r[100500];
map<int, int> mp;
vector<int> z[100500];
bool dfs(int p, int u) {
  d[u] = l;
  z[l].push_back(u);
  if (v[u][0]) {
    if (r[v[u][0]] > 0) {
      if (r[v[u][0]] != r[u]) {
        return false;
      }
    } else {
      r[v[u][0]] = r[u];
      if (!dfs(u, v[u][0])) {
        return false;
      }
    }
  } else {
    if (r[u] == 1 && f[u] + f[u] != a) {
      return false;
    }
  }
  if (v[u][1]) {
    if (r[v[u][1]] > 0) {
      if (r[v[u][1]] != r[u]) {
        return false;
      }
    } else {
      r[v[u][1]] = r[u];
      if (!dfs(u, v[u][1])) {
        return false;
      }
    }
  } else {
    if (r[u] == 2 && f[u] + f[u] != b) {
      return false;
    }
  }
  return true;
}
void solve() {
  scanf("%d%d%d", &n, &a, &b);
  for (j = 1; j <= n; j++) {
    scanf("%d", &f[j]);
    if (q1 = mp[a - f[j]]) {
      v[j][0] = q1;
      v[q1][0] = j;
    }
    if (q2 = mp[b - f[j]]) {
      v[j][1] = q2;
      v[q2][1] = j;
    }
    mp[f[j]] = j;
  }
  for (j = 1; j <= n; j++) {
    if (!d[j]) {
      ++l;
      r[j] = 1;
      if (!dfs(0, j)) {
        for (i = 0; i < z[l].size(); i++) {
          d[z[l][i]] = r[z[l][i]] = 0;
        }
        z[l].clear();
        r[j] = 2;
        if (!dfs(0, j)) {
          printf("NO");
          return;
        }
      }
    }
  }
  printf("YES\n");
  for (j = 1; j <= n; j++) {
    printf("%d ", r[j] - 1);
  }
}
int main() {
  srand(1337);
  solve();
  return 0;
}
