#include <bits/stdc++.h>
#pragma GCC optimize("O1")
#pragma GCC target("avx,avx2,fma")
using namespace std;
long long int modexp(long long int x, long long int y, long long int m) {
  long long int ans = 1;
  while (y > 0) {
    if (y & 1) {
      ans *= x;
      ans %= m;
      --y;
    } else {
      y /= 2;
      x *= x;
      x %= m;
    }
  }
  return ans;
}
long long int minv(long long int a, long long int m) {
  return modexp(a, m - 2, m);
}
map<long long int, long long int> mp1, mp2, num;
map<long long int, long long int> par;
priority_queue<int> pq;
map<long long int, int> setted;
long long int cnt = 0;
long long int n, a, b;
long long int reduce1(map<long long int, long long int>::iterator it) {
  if (it == mp1.end()) return -1;
  if (it->second == 0) return -1;
  if (mp1.find(a - it->first) == mp1.end()) return 0;
  par[it->first] = 0;
  par[a - it->first] = 0;
  setted[it->first] = 1;
  setted[a - it->first] = 1;
  mp2[it->first] = 0;
  mp2[a - it->first] = 0;
  mp1[it->first] = 0;
  mp1[a - it->first] = 0;
  mp2[b - (a - it->first)] = 0;
  if (it->first == a - it->first)
    cnt++;
  else
    cnt += 2;
  return reduce1(mp1.find(b - (a - it->first)));
}
long long int reduce2(map<long long int, long long int>::iterator it) {
  if (it == mp2.end()) return -1;
  if (it->second == 0) return -1;
  if (mp2.find(b - it->first) == mp2.end()) return 0;
  par[it->first] = 1;
  par[b - it->first] = 1;
  setted[it->first] = 1;
  setted[b - it->first] = 1;
  mp1[it->first] = 0;
  mp1[b - it->first] = 0;
  mp2[it->first] = 0;
  mp2[b - it->first] = 0;
  mp1[a - (b - it->first)] = 0;
  if (it->first == b - it->first)
    cnt++;
  else
    cnt += 2;
  return reduce2(mp2.find(a - (b - it->first)));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int tt = 1;
  while (tt--) {
    cin >> n >> a >> b;
    vector<long long int> p(n);
    for (int i = 0; i < n; i++) cin >> p[i], num[p[i]] = 1;
    if (a == b) {
      bool ff = 1;
      for (int i = 0; i < n; ++i)
        if (num.find(a - p[i]) == num.end()) {
          ff = 0;
          break;
        }
      if (ff == 0) {
        cout << "NO\n";
        break;
      }
      cout << "YES\n";
      for (int i = 0; i < n; ++i) cout << 0 << " ";
      cout << "\n";
      break;
    }
    for (int i = 0; i < n; ++i) {
      if (num[a - p[i]] == 1) {
        mp1[p[i]] = 1, mp1[a - p[i]] = 1;
      }
      if (num[b - p[i]] == 1) {
        mp2[p[i]] = 1, mp2[b - p[i]] = 1;
      }
    }
    bool fl = 1;
    for (auto it = mp1.begin(); it != mp1.end(); ++it) {
      if (setted[it->first] == 1 || mp2[it->first] == 1) continue;
      auto itr = it;
      int temp = reduce1(itr);
      if (temp == 0) {
        fl = 0;
        break;
      }
    }
    if (fl == 0) {
      cout << "NO\n";
      exit(0);
    }
    for (auto it = mp2.begin(); it != mp2.end(); ++it) {
      if (setted[it->first] == 1) continue;
      auto itr = it;
      int temp = reduce2(itr);
      if (temp == 0) {
        fl = 0;
        break;
      }
    }
    if (fl == 0) {
      cout << "NO\n";
      exit(0);
    }
    if (cnt == n) {
      cout << "YES\n";
      for (int i = 0; i < n; ++i) cout << par[p[i]] << " ";
      cout << "\n";
    } else
      cout << "NO\n";
  }
}
