#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-9;
template <class T>
bool INRANGE(T x, T a, T b) {
  return a <= x && x <= b;
}
template <class T>
void amin(T &a, T v) {
  if (a > v) a = v;
}
template <class T>
void amax(T &a, T v) {
  if (a < v) a = v;
}
int ROUND(double x) { return (int)(x + 0.5); }
bool ISINT(double x) { return fabs(ROUND(x) - x) <= EPS; }
bool ISEQUAL(double x, double y) {
  return fabs(x - y) <= EPS * max(1.0, max(fabs(x), fabs(y)));
}
double SQSUM(double x, double y) { return x * x + y * y; }
vector<vector<int> > graph;
vector<bool> visited;
vector<int> hajiNodes;
set<int> A;
set<int> B;
int a, b;
vector<int> p;
void dfs(int idx) {
  visited[idx] = true;
  bool haji = true;
  for (int i = 0; i < ((int)(graph[idx]).size()); ++i) {
    if (!visited[graph[idx][i]]) {
      haji = false;
      dfs(graph[idx][i]);
    }
  }
  if (haji) {
    hajiNodes.push_back(idx);
  }
}
void dfsPair(int idx, int lastIdx, int numStep) {
  visited[idx] = true;
  if (numStep % 2 == 1) {
    if (p[idx] + p[lastIdx] == a) {
      A.insert(idx);
      A.insert(lastIdx);
    } else if (p[idx] + p[lastIdx] == b) {
      B.insert(idx);
      B.insert(lastIdx);
    }
  }
  for (int i = 0; i < ((int)(graph[idx]).size()); ++i) {
    if (!visited[graph[idx][i]]) {
      dfsPair(graph[idx][i], idx, numStep + 1);
    }
  }
}
int main() {
  int n;
  A.clear();
  B.clear();
  scanf("%d %d %d", &n, &a, &b);
  p.clear();
  p.resize(n);
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    int tmp;
    scanf("%d ", &tmp);
    p[i] = tmp;
    mp[p[i]] = i;
  }
  graph.clear();
  graph.resize(n);
  visited.clear();
  visited.resize(n);
  if (a == b) {
    b = (-1);
  }
  for (int i = 0; i < n; ++i) {
    if (a != 2 * p[i] && mp.count(a - p[i])) {
      graph[i].push_back(mp[a - p[i]]);
    }
    if (b != 2 * p[i] && mp.count(b - p[i])) {
      graph[i].push_back(mp[b - p[i]]);
    }
  }
  for (int i = 0; i < n; ++i) {
    if (!visited[i]) {
      dfs(i);
    }
  }
  visited.clear();
  visited.resize(n);
  for (const int startNode : hajiNodes) {
    if (!visited[startNode] && 2 * p[startNode] != a && 2 * p[startNode] != b) {
      dfsPair(startNode, (-1), 0);
    }
  }
  bool ok = true;
  for (int i = 0; i < n; ++i) {
    if (!A.count(i) && !B.count(i)) {
      if (a == 2 * p[i]) {
        A.insert(i);
      } else if (b == 2 * p[i]) {
        B.insert(i);
      } else {
        ok = false;
      }
    }
  }
  if (!ok) {
    printf("NO\n");
  } else {
    printf("YES\n");
    vector<int> ans(n);
    for (int i = 0; i < n; ++i) {
      int groupID = 0;
      if (A.count(i)) {
        groupID = 0;
      } else if (B.count(i)) {
        groupID = 1;
      } else {
        assert(0);
      }
      printf("%d ", groupID);
    }
    printf("\n");
  }
  return 0;
}
