#include <bits/stdc++.h>
using namespace std;
long long n, a, b;
vector<long long> p(100005);
set<long long> in;
map<long long, int> out;
map<long long, long long> seta;
map<long long, long long> setb;
map<long long, bool> was;
void initialization() {
  cin >> n >> a >> b;
  for (long long i = 0; i < n; ++i) {
    cin >> p[i];
    in.insert(p[i]);
  }
}
void solve() {}
void print() {}
void flush() {}
int main() {
  ios::sync_with_stdio(0);
  initialization();
  solve();
  print();
  if (a == b) {
    bool q = true;
    for (int i = 0; i < n; ++i)
      if (in.find(a - p[i]) == in.end()) q = false;
    if (q) {
      cout << "YES" << endl;
      for (int i = 0; i < n; ++i) cout << 0 << ' ';
    } else
      cout << "NO";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    bool q = false;
    auto it1 = in.find(a - p[i]);
    auto it2 = in.find(b - p[i]);
    if (it1 != in.end()) {
      seta[p[i]] = *it1;
      q = true;
      out[p[i]] = 1;
    }
    if (it2 != in.end()) {
      setb[p[i]] = *it2;
      q = true;
      if (out[p[i]] == 0) out[p[i]] = 2;
      if (out[p[i]] == 1) out[p[i]] = 3;
    }
    if (!q) {
      cout << "NO";
      return 0;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (!was[p[i]] && out[p[i]] == 1) {
      was[p[i]] = true;
      long long cur = seta[p[i]];
      int prev = 1;
      while (!was[cur] && out[cur] == 3) {
        was[cur] = true;
        out[cur] = 1;
        if (prev == 1) {
          cur = setb[cur];
          prev = 2;
        } else {
          cur = seta[cur];
          prev = 1;
        }
      }
      if (was[cur] || out[cur] == 1) {
        was[cur] = true;
      } else {
        cout << "NO";
        return 0;
      }
    }
    if (!was[p[i]] && out[p[i]] == 2) {
      was[p[i]] = true;
      long long cur = setb[p[i]];
      int prev = 2;
      while (!was[cur] && out[cur] == 3) {
        was[cur] = true;
        out[cur] = 2;
        if (prev == 1) {
          cur = setb[cur];
          prev = 2;
        } else {
          cur = seta[cur];
          prev = 1;
        }
      }
      if (was[cur] || out[cur] == 2) {
        was[cur] = true;
      } else {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < n; ++i) {
    if (out[p[i]] == 3) out[p[i]] = 1;
    cout << out[p[i]] - 1 << ' ';
  }
  return 0;
}
