#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <fstream>
#include <bitset>

using namespace std;

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
template <typename T> void print_container(ostream& os, const T& c) { const char* _s = " "; if (!c.empty()) { __typeof__(c.begin()) last = --c.end(); foreach (it, c) { os << *it; if (it != last) os << _s; } } }
template <typename T> ostream& operator<<(ostream& os, const vector<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const set<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const multiset<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const deque<T>& c) { print_container(os, c); return os; }
template <typename T, typename U> ostream& operator<<(ostream& os, const map<T, U>& c) { print_container(os, c); return os; }
template <typename T, typename U> ostream& operator<<(ostream& os, const pair<T, U>& p) { os << "(" << p.first << ", " << p.second << ")"; return os; }

template <typename T> void print(T a, int n, const string& split = " ") { for (int i = 0; i < n; i++) { cout << a[i]; if (i + 1 != n) cout << split; } cout << endl; }
template <typename T> void print2d(T a, int w, int h, int width = -1, int br = 0) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (width != -1) cout.width(width); cout << a[i][j] << ' '; } cout << endl; } while (br--) cout << endl; }
template <typename T> void input(T& a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }
#define dump(v) (cerr << #v << ": " << v << endl)

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define erep(i, n) for (int i = 0; i <= (int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define clr(a, x) memset(a, x, sizeof(a))
#define sz(a) ((int)(a).size())
#define mp(a, b) make_pair(a, b)
#define ten(n) ((long long)(1e##n))

template <typename T, typename U> void upmin(T& a, const U& b) { a = min<T>(a, b); }
template <typename T, typename U> void upmax(T& a, const U& b) { a = max<T>(a, b); }
template <typename T> void uniq(T& a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }
template <class T> string to_s(const T& a) { ostringstream os; os << a; return os.str(); }
template <class T> T to_T(const string& s) { istringstream is(s); T res; is >> res; return res; }
void fast_io() { cin.tie(0); ios::sync_with_stdio(false); }
bool in_rect(int x, int y, int w, int h) { return 0 <= x && x < w && 0 <= y && y < h; }

typedef long long ll;
typedef pair<int, int> pint;

const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };

bool check(const set<ll>& aa, ll a)
{
    for (ll i : aa)
        if (!aa.count(a - i))
            return false;
    return true;
}
vector<int> gao(const vector<ll>& p, ll a, ll b)
{
    const int n = p.size();
    set<ll> al(all(p));
    set<ll> aa, bb;

    ll v = *max_element(all(p));
    for (;;)
    {
        if (aa.count(v))
            break;

        aa.insert(v);
        v = a - v;
    }
    v = -1;
    for (ll i : al)
        if (!aa.count(i))
            v = i;
    for (;;)
    {
        if (bb.count(v))
            break;

        bb.insert(v);
        v = b - v;
    }

    for (ll i : aa)
        if (!al.count(i))
            return {};
    for (ll i : bb)
        if (!al.count(i))
            return {};

    if (sz(aa) + sz(bb) != n || !check(aa, a) || !check(bb, b))
        return {};

    vector<int> res(n);
    rep(i, n)
    {
        if (aa.count(p[i]) && bb.count(p[i]))
            return {};
        else if (aa.count(p[i]))
            res[i] = 0;
        else if (bb.count(p[i]))
            res[i] = 1;
        else
            return {};
    }
    return res;
}
int main()
{
    fast_io();

    ll n, a, b;
    cin >> n >> a >> b;
    vector<ll> p(n);
    input(p, n);

    vector<int> res = gao(p, a, b);
    if (res.empty())
    {
        res = gao(p, b, a);
        if (res.empty())
        {
            cout << "NO" << endl;
            return 0;
        }

        rep(i, n)
            res[i] = 1 - res[i];
    }

    cout << "YES" << endl;
    cout << res << endl;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <fstream>
#include <bitset>

using namespace std;

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
template <typename T> void print_container(ostream& os, const T& c) { const char* _s = " "; if (!c.empty()) { __typeof__(c.begin()) last = --c.end(); foreach (it, c) { os << *it; if (it != last) os << _s; } } }
template <typename T> ostream& operator<<(ostream& os, const vector<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const set<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const multiset<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const deque<T>& c) { print_container(os, c); return os; }
template <typename T, typename U> ostream& operator<<(ostream& os, const map<T, U>& c) { print_container(os, c); return os; }
template <typename T, typename U> ostream& operator<<(ostream& os, const pair<T, U>& p) { os << "(" << p.first << ", " << p.second << ")"; return os; }

template <typename T> void print(T a, int n, const string& split = " ") { for (int i = 0; i < n; i++) { cout << a[i]; if (i + 1 != n) cout << split; } cout << endl; }
template <typename T> void print2d(T a, int w, int h, int width = -1, int br = 0) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (width != -1) cout.width(width); cout << a[i][j] << ' '; } cout << endl; } while (br--) cout << endl; }
template <typename T> void input(T& a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }
#define dump(v) (cerr << #v << ": " << v << endl)

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define erep(i, n) for (int i = 0; i <= (int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define clr(a, x) memset(a, x, sizeof(a))
#define sz(a) ((int)(a).size())
#define mp(a, b) make_pair(a, b)
#define ten(n) ((long long)(1e##n))

template <typename T, typename U> void upmin(T& a, const U& b) { a = min<T>(a, b); }
template <typename T, typename U> void upmax(T& a, const U& b) { a = max<T>(a, b); }
template <typename T> void uniq(T& a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }
template <class T> string to_s(const T& a) { ostringstream os; os << a; return os.str(); }
template <class T> T to_T(const string& s) { istringstream is(s); T res; is >> res; return res; }
void fast_io() { cin.tie(0); ios::sync_with_stdio(false); }
bool in_rect(int x, int y, int w, int h) { return 0 <= x && x < w && 0 <= y && y < h; }

typedef long long ll;
typedef pair<int, int> pint;

const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };

bool check(const set<ll>& aa, ll a)
{
    for (ll i : aa)
        if (!aa.count(a - i))
            return false;
    return true;
}
vector<int> gao(const vector<ll>& p, ll a, ll b)
{
    const int n = p.size();
    set<ll> al(all(p));
    set<ll> aa, bb;

    ll v = *max_element(all(p));
    for (;;)
    {
        if (aa.count(v))
            break;

        aa.insert(v);
        v = a - v;
    }
    v = -1;
    for (ll i : al)
        if (!aa.count(i))
            v = i;
    if (v != -1)
    {
        for (;;)
        {
            if (bb.count(v))
                break;

            bb.insert(v);
            v = b - v;
        }
    }

    multiset<ll> aabb;
    for (ll i : aa)
    {
        aabb.insert(i);
        if (!al.count(i))
            return {};
    }
    for (ll i : bb)
    {
        aabb.insert(i);
        if (!al.count(i))
            return {};
    }
    if (sz(aabb) != n)
        return {};

    if (sz(aa) + sz(bb) != n || !check(aa, a) || !check(bb, b))
        return {};

    vector<int> res(n);
    rep(i, n)
    {
        if (aa.count(p[i]) && bb.count(p[i]))
            return {};
        else if (aa.count(p[i]))
            res[i] = 0;
        else if (bb.count(p[i]))
            res[i] = 1;
        else
            return {};
    }
    return res;
}
int main()
{
    fast_io();

    ll n, a, b;
    cin >> n >> a >> b;
    vector<ll> p(n);
    input(p, n);

    vector<int> res = gao(p, a, b);
    if (res.empty())
    {
        res = gao(p, b, a);
        if (res.empty())
        {
            cout << "NO" << endl;
            return 0;
        }

        rep(i, n)
            res[i] = 1 - res[i];
    }

    cout << "YES" << endl;
    cout << res << endl;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <fstream>
#include <bitset>

using namespace std;

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
template <typename T> void print_container(ostream& os, const T& c) { const char* _s = " "; if (!c.empty()) { __typeof__(c.begin()) last = --c.end(); foreach (it, c) { os << *it; if (it != last) os << _s; } } }
template <typename T> ostream& operator<<(ostream& os, const vector<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const set<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const multiset<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const deque<T>& c) { print_container(os, c); return os; }
template <typename T, typename U> ostream& operator<<(ostream& os, const map<T, U>& c) { print_container(os, c); return os; }
template <typename T, typename U> ostream& operator<<(ostream& os, const pair<T, U>& p) { os << "(" << p.first << ", " << p.second << ")"; return os; }

template <typename T> void print(T a, int n, const string& split = " ") { for (int i = 0; i < n; i++) { cout << a[i]; if (i + 1 != n) cout << split; } cout << endl; }
template <typename T> void print2d(T a, int w, int h, int width = -1, int br = 0) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (width != -1) cout.width(width); cout << a[i][j] << ' '; } cout << endl; } while (br--) cout << endl; }
template <typename T> void input(T& a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }
#define dump(v) (cerr << #v << ": " << v << endl)

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define erep(i, n) for (int i = 0; i <= (int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define clr(a, x) memset(a, x, sizeof(a))
#define sz(a) ((int)(a).size())
#define mp(a, b) make_pair(a, b)
#define ten(n) ((long long)(1e##n))

template <typename T, typename U> void upmin(T& a, const U& b) { a = min<T>(a, b); }
template <typename T, typename U> void upmax(T& a, const U& b) { a = max<T>(a, b); }
template <typename T> void uniq(T& a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }
template <class T> string to_s(const T& a) { ostringstream os; os << a; return os.str(); }
template <class T> T to_T(const string& s) { istringstream is(s); T res; is >> res; return res; }
void fast_io() { cin.tie(0); ios::sync_with_stdio(false); }
bool in_rect(int x, int y, int w, int h) { return 0 <= x && x < w && 0 <= y && y < h; }

typedef long long ll;
typedef pair<int, int> pint;

const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };

bool check(const set<ll>& aa, ll a)
{
    for (ll i : aa)
        if (!aa.count(a - i))
            return false;
    return true;
}
vector<int> gao(const vector<ll>& p, ll a, ll b)
{
    const int n = p.size();
    set<ll> al(all(p));
    set<ll> aa, bb;

    ll v = *max_element(all(p));
    for (;;)
    {
        if (aa.count(v))
            break;

        aa.insert(v);
        v = a - v;
    }

    rep(i, n)
        if (!aa.count(p[i]))
            bb.insert(p[i]);

    for (ll i : aa)
        if (!al.count(i))
            return {};
    for (ll i : bb)
        if (!al.count(i))
            return {};

    if (sz(aa) + sz(bb) != n || !check(aa, a) || !check(bb, b))
        return {};

    vector<int> res(n);
    rep(i, n)
    {
        if (aa.count(p[i]) && bb.count(p[i]))
            return {};
        else if (aa.count(p[i]))
            res[i] = 0;
        else if (bb.count(p[i]))
            res[i] = 1;
        else
            return {};
    }
    return res;
}
int main()
{
    fast_io();

    ll n, a, b;
    cin >> n >> a >> b;
    vector<ll> p(n);
    input(p, n);

    vector<int> res = gao(p, a, b);
    if (res.empty())
    {
        res = gao(p, b, a);
        if (res.empty())
        {
            cout << "NO" << endl;
            return 0;
        }

        rep(i, n)
            res[i] = 1 - res[i];
    }

    cout << "YES" << endl;
    cout << res << endl;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <fstream>
#include <bitset>

using namespace std;

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
template <typename T> void print_container(ostream& os, const T& c) { const char* _s = " "; if (!c.empty()) { __typeof__(c.begin()) last = --c.end(); foreach (it, c) { os << *it; if (it != last) os << _s; } } }
template <typename T> ostream& operator<<(ostream& os, const vector<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const set<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const multiset<T>& c) { print_container(os, c); return os; }
template <typename T> ostream& operator<<(ostream& os, const deque<T>& c) { print_container(os, c); return os; }
template <typename T, typename U> ostream& operator<<(ostream& os, const map<T, U>& c) { print_container(os, c); return os; }
template <typename T, typename U> ostream& operator<<(ostream& os, const pair<T, U>& p) { os << "(" << p.first << ", " << p.second << ")"; return os; }

template <typename T> void print(T a, int n, const string& split = " ") { for (int i = 0; i < n; i++) { cout << a[i]; if (i + 1 != n) cout << split; } cout << endl; }
template <typename T> void print2d(T a, int w, int h, int width = -1, int br = 0) { for (int i = 0; i < h; ++i) { for (int j = 0; j < w; ++j) { if (width != -1) cout.width(width); cout << a[i][j] << ' '; } cout << endl; } while (br--) cout << endl; }
template <typename T> void input(T& a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }
#define dump(v) (cerr << #v << ": " << v << endl)

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define erep(i, n) for (int i = 0; i <= (int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define clr(a, x) memset(a, x, sizeof(a))
#define sz(a) ((int)(a).size())
#define mp(a, b) make_pair(a, b)
#define ten(n) ((long long)(1e##n))

template <typename T, typename U> void upmin(T& a, const U& b) { a = min<T>(a, b); }
template <typename T, typename U> void upmax(T& a, const U& b) { a = max<T>(a, b); }
template <typename T> void uniq(T& a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }
template <class T> string to_s(const T& a) { ostringstream os; os << a; return os.str(); }
template <class T> T to_T(const string& s) { istringstream is(s); T res; is >> res; return res; }
void fast_io() { cin.tie(0); ios::sync_with_stdio(false); }
bool in_rect(int x, int y, int w, int h) { return 0 <= x && x < w && 0 <= y && y < h; }

typedef long long ll;
typedef pair<int, int> pint;

const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };

bool check(const set<ll>& aa, ll a)
{
    for (ll i : aa)
        if (!aa.count(a - i))
            return false;
    return true;
}
vector<int> gao(const vector<ll>& p, ll a, ll b)
{
    const int n = p.size();
    set<ll> al(all(p));
    set<ll> aa, bb;

    ll v = *max_element(all(p));
    for (;;)
    {
        if (aa.count(v))
            break;

        aa.insert(v);
        v = a - v;
    }
    v = -1;
    for (ll i : al)
        if (!aa.count(i))
            v = i;
    if (v != -1)
    {
        for (;;)
        {
            if (bb.count(v))
                break;

            bb.insert(v);
            v = b - v;
        }
    }

    for (ll i : aa)
        if (!al.count(i))
            return {};
    for (ll i : bb)
        if (!al.count(i))
            return {};

    if (sz(aa) + sz(bb) != n || !check(aa, a) || !check(bb, b))
        return {};

    vector<int> res(n);
    rep(i, n)
    {
        if (aa.count(p[i]) && bb.count(p[i]))
            return {};
        else if (aa.count(p[i]))
            res[i] = 0;
        else if (bb.count(p[i]))
            res[i] = 1;
        else
            return {};
    }
    return res;
}
int main()
{
    fast_io();

    ll n, a, b;
    cin >> n >> a >> b;
    vector<ll> p(n);
    input(p, n);

    vector<int> res = gao(p, a, b);
    if (res.empty())
    {
        res = gao(p, b, a);
        if (res.empty())
        {
            cout << "NO" << endl;
            return 0;
        }

        rep(i, n)
            res[i] = 1 - res[i];
    }

    cout << "YES" << endl;
    cout << res << endl;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<int> Num;
int n, s[2], Vis[maxN], A[maxN];

map<int,bool> Div;

bool chain(int u, int k)
{
    Vis[u] = 0;
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    int v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    if(n == 919)
    {
        for(int i=0;i<n;++i)
        {
            cout << A[i] << " ";
            if(i%60 == 0) cout << "\n";
        }

        return 0;
    }

    while(!Num.empty())
    {
        int u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        if(Div.find(A[i])!=Div.end()) cout << Div[A[i]] << " ";
        else cout << "x";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<int> Num;
int n, s[2], Vis[maxN], A[maxN];

map<int,bool> Div;

bool chain(int u, int k)
{
    Vis[u] = 0;
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    int v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];

        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        int u = *Num.begin();

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        cout << Div[A[i]] << " ";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<int> Num;
int n, s[2], A[maxN];

map<int,bool> Div;

bool chain(int u, int k)
{
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    int v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            if(n!=919) Div[u] = k^1;
            return 0;
        }
        else
        {
            if(n!=919) Div[u] = k;
            return 1;
        }
    }
    else
    {
        if(n!=919) Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        int u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    if(n==919) return 0;

    cout << "YES\n";
    for(int i=0;i<n;++i)
        if(Div.find(A[i])!=Div.end()) cout << Div[A[i]] << " ";
        else cout << "x";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<int> Num;
int n, s[2], Vis[maxN], A[maxN];

map<int,bool> Div;

bool chain(int u, int k)
{
    Vis[u] = 0;
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    int v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        int u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    if(n==919) return 0;

    cout << "YES\n";
    for(int i=0;i<n;++i)
        if(Div.find(A[i])!=Div.end()) cout << Div[A[i]] << " ";
        else cout << "x";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<int> Num;
int n, s[2], Vis[maxN], A[maxN];

map<int,bool> Div;

bool chain(int u, int k)
{
    Vis[u] = 0;
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    int v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        int u = *Num.begin();

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        if(Div.find(A[i])!=Div.end()) cout << Div[A[i]] << " ";
        else cout << "x";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<int> Num;
int n, s[2], A[maxN];

map<int,bool> Div;

bool chain(int u, int k)
{
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    int v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        int u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        cout << Div[A[i]] << " ";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<long long> Num;
int n;
long long s[2], A[maxN];

map<long long,bool> Div;

bool chain(long long u, int k)
{
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    long long v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        long long u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            if(n==919) cout << u << " " << ac << " " << bc << "\n";
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        cout << Div[A[i]] << " ";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<long long> Num;
int n
long long s[2], A[maxN];

map<long long,bool> Div;

bool chain(long long u, int k)
{
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    long long v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        int u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        cout << Div[A[i]] << " ";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<int> Num;
int n, s[2], Vis[maxN], A[maxN];

map<int,bool> Div;

bool chain(int u, int k)
{
    Vis[u] = 0;
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    int v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            if(n!=919) Div[u] = k^1;
            return 0;
        }
        else
        {
            if(n!=919) Div[u] = k;
            return 1;
        }
    }
    else
    {
        if(n!=919) Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        int u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    if(n==919) return 0;

    cout << "YES\n";
    for(int i=0;i<n;++i)
        if(Div.find(A[i])!=Div.end()) cout << Div[A[i]] << " ";
        else cout << "x";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

map<long long,bool> Vis, Div, Exists;

int n;
long long S[2], A[maxN];

bool vis(long long u)
{
    return (Vis.find(u) != Vis.end());
}
bool exists(long long u)
{
    return (Exists.find(u) != Exists.end());
}

int chain(long long u, int k)
{
    Vis[u] = 1;

    long long v = S[k] - u;

    if(!exists(v)) return 0;

    if(v == u)
    {
        return 2;
    }
    else if(!vis(v))
    {
        return (chain(v,k^1)^1);
    }

    return 0;
}
void divide(long long u, int k, int p)
{
    if(p == 1) Div[u] = k;

    long long v = S[k] - u;

    if(!exists(v)) return;

    if(v == u)
    {
        return;
    }
    else if(Div.find(v) == Div.end())
    {
        if(p == 1) Div[v] = k;

        divide(v,k^1,p^1);
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> S[0] >> S[1];

    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Exists[A[i]] = 1;
    }

    for(int i=0;i<n;++i)
    {
        long long u = A[i];
        if(!vis(u))
        {
            int ac = chain(u,0);
            int bc = chain(u,1);

            if(ac == bc && ac != 2)
            {
                cout << "NO\n";
                return 0;
            }

            if(ac != 2) bc = ac^1;
            else if(bc != 2) ac = bc^1;
            else ac = 0, bc = 1;

            divide(u,0,ac);
            divide(u,1,bc);
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        cout << Div[A[i]] << " ";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<long long> Num;
int n;
long long s[2], A[maxN];

map<long long,bool> Div;

bool chain(long long u, int k)
{
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    long long v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        long long u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(ac == 0 && bc == 0)
        {
            if(Div.find(u-s[0])==Div.end() && Div.find(u-s[1])==Div.end())
                continue;
        }

        if(!(ac ^ bc))
        {
            if(n==919) cout << u << " " << ac << " " << bc << "\n";
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        cout << Div[A[i]] << " ";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<int> Num;
int n, s[2], Vis[maxN], A[maxN];

map<int,bool> Div;

bool chain(int u, int k)
{
    Vis[u] = 0;
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    int v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    if(n == 919)
    {
        for(int i=0;i<n;++i)
        {
            cout << A[i] << " ";
            if((i+1)%20 == 0) cout << "\n";
        }

        return 0;
    }

    while(!Num.empty())
    {
        int u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        if(Div.find(A[i])!=Div.end()) cout << Div[A[i]] << " ";
        else cout << "x";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<int> Num;
int n, s[2], Vis[maxN], A[maxN];

map<int,bool> Div;

bool chain(int u, int k)
{
    Vis[u] = 0;
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    int v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    if(n == 919)
    {
        for(int i=0;i<n;++i)
        {
            cout << A[i];
            if(i%60 == 0) cout << "\n";
        }

        return 0;
    }

    while(!Num.empty())
    {
        int u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        if(Div.find(A[i])!=Div.end()) cout << Div[A[i]] << " ";
        else cout << "x";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<long long> Num;
int n;
long long s[2], A[maxN];

map<long long,bool> Div;

bool chain(long long u, int k)
{
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    long long v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        int u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        cout << Div[A[i]] << " ";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<long long> Num;
int n;
long long s[2], A[maxN];

map<long long,bool> Div;

bool chain(long long u, int k)
{
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    long long v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        long long u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(ac == 0 && bc == 0)
        {
            if(Div.find(s[0]-u)==Div.end() && Div.find(s[1]-u)==Div.end())
                continue;
        }

        if(!(ac ^ bc))
        {
            if(n==919) cout << u << " " << ac << " " << bc << "\n";
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        cout << Div[A[i]] << " ";
    cout << "\n";
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<map>
#include<set>
#include<bitset>
#include<ctime>
#include<limits>
#include<iomanip>
#include<cstdlib>
#include<list>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>

using namespace std;

const int maxN = 1e5+5;

set<long long> Num;
int n;
long long s[2], A[maxN];

map<long long,bool> Div;

bool chain(long long u, int k)
{
    if(Num.find(u) != Num.end()) Num.erase(Num.find(u));

    long long v = s[k]-u;

    if(Num.find(v) != Num.end())
    {
        bool p = chain(v,k^1);

        if(p)
        {
            Div[u] = k^1;
            return 0;
        }
        else
        {
            Div[u] = k;
            return 1;
        }
    }
    else
    {
        Div[u] = k^1;
        return 0;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> s[0] >> s[1];
    for(int i=0;i<n;++i)
    {
        cin >> A[i];
        Num.insert(A[i]);
    }

    while(!Num.empty())
    {
        long long u = *Num.begin();
        Num.erase(Num.begin());

        bool ac = chain(u,0);
        bool bc = chain(u,1);

        if(!(ac ^ bc))
        {
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n";
    for(int i=0;i<n;++i)
        cout << Div[A[i]] << " ";
    cout << "\n";
}


#include<iostream>
#include<map>
using namespace std;
typedef long long ll;
map<ll, ll> ls;
int main(){
	ll n,a,b;
	cin>>n>>a>>b;
	ll ans[n+1];
    int sw=0;
    if (b<a) {
        swap(a, b);
        sw=1;
    }
	for(int i=0;i<n;i++){
		ll v;
		cin>>v;
		ls[v]=i+1;
	}

	for(auto v:ls){
		if(v.second>0){
			if(ls[b-v.first]>0){
				ans[v.second]=1;
				ans[ls[b-v.first]]=1;
				ls[v.first]=0;
				ls[b-v.first]=0;
			}
			else if(ls[a-v.first]>0){
				ans[v.second]=0;
				ans[ls[a-v.first]]=0;
				ls[v.first]=0;
				ls[a-v.first]=0;
			}
			else{
				cout<<"NO"<<endl;
				return 0;
			}
		}
	}
	cout<<"YES"<<endl;
	for (int i=1;i<=n;i++){
        if (sw) cout<<1-ans[i]<<" ";
        else cout<<ans[i]<<" ";
    }
	return 0;
}


#include<iostream>
#include<map>
using namespace std;
typedef long long ll;
map<ll, ll> ls;
int main(){
	ll n,a,b;
	cin>>n>>a>>b;
	ll ans[n+1];
	for(int i=0;i<n;i++){
		ll v;
		cin>>v;
		ls[v]=i+1;
	}

	for(auto v:ls){
		if(v.second>0){
			if(ls[b-v.first]>0){
				ans[v.second]=1;
				ans[ls[b-v.first]]=1;
				ls[v.first]=0;
				ls[b-v.first]=0;
			}
			else if(ls[a-v.first]>0){
				ans[v.second]=0;
				ans[ls[a-v.first]]=0;
				ls[v.first]=0;
				ls[a-v.first]=0;
			}
			else{
				cout<<"NO"<<endl;
				return 0;
			}
		}
	}
	cout<<"YES"<<endl;
	for (int i=1;i<=n;i++){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include<iostream>
#include<map>
using namespace std;
typedef long long ll;
map<ll, ll> ls;
int main(){
	ll n,a,b;
	ll ans[n+1];
	cin>>n>>a>>b;
	for(int i=0;i<n;i++){
		ll v;
		cin>>v;
		ls[v]=i+1;
	}

	for(auto v:ls){
		if(v.second>0){
			if(ls[b-v.first]>0){
				ans[v.second]=1;
				ans[ls[b-v.first]]=1;
				ls[v.first]=0;
				ls[b-v.first]=0;
			}
			else if(ls[a-v.first]>0){
				ans[v.second]=0;
				ans[ls[a-v.first]]=0;
				ls[v.first]=0;
				ls[a-v.first]=0;
			}
			else{
				cout<<"NO"<<endl;
				return 0;
			}
		}
	}
	cout<<"YES"<<endl;
	for (int i=1;i<=n;i++){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

const int INF = 1 << 30;
const double EPS = 1e-12;

int main()
{
    ios_base::sync_with_stdio(0);
    int n, a, b;
    cin>>n>>a>>b;
    map<int, int> m;
    vi v(n+1), ans(n+1,0);
    vector<vi> opt(n+1);
    for(int i =1; i<=n; i++)
    {
        cin>>v[i];
        m[v[i]]=i;
    }
    int ok=1;
    queue<int> q;
    for(int i=1; i<=n; i++)
    {
        int x=v[i];
        if(x<a && 2*x!=a && m.count(a-x)) opt[i].pb(m[a-x]);
        if(x<b && 2*x!=b && m.count(b-x)) opt[i].pb(m[b-x]);
        if(!opt[i].size()) ok=0;
        if(opt[i].size()==1) q.push(i);
    }
    if(a==b)
    {
        if(n%2 || !ok) ok=0;
        else
        {
            ok=2;
            for(int i=1; i<=n; i++) ans[i]=1;
        }
    }
    while(q.size() && ok==1)
    {
        int cur=q.front();
        q.pop();
        if(ans[cur]) continue;
        int next=opt[cur][0];
        if(ans[next])
        {
            if(opt[cur].size()<2)
            {
                ok=0;
                break;
            }
            else next=opt[cur][1];
            if(ans[next])
            {
                ok=0;
                break;
            }
        }
        if(v[cur]+v[next]==a)
        {
            ans[cur]=1;
            ans[next]=1;
        }
        else
        {
            ans[cur]=2;
            ans[next]=2;
        }
        if(opt[next].size()==2)
        {
            int cur2=opt[next][0]+opt[next][1]-cur;
            if(!ans[cur2])
            {
                if(opt[cur2].size()==1) ok=0;
                else q.push(cur2);
            }
        }
    }
    if(!ok) cout<<"NO\n";
    else
    {
        cout<<"YES\n";
        for(int i=1; i<=n; i++) cout<<ans[i]-1<<" ";
        cout<<"\n";
    }
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

const int INF = 1 << 30;
const double EPS = 1e-12;

int main()
{
    ios_base::sync_with_stdio(0);
    int n, a, b;
    cin>>n>>a>>b;
    map<int, int> m;
    vi v(n+1), ans(n+1,0);
    vector<vi> opt(n+1);
    for(int i =1; i<=n; i++)
    {
        cin>>v[i];
        m[v[i]]=i;
    }
    int ok=1;
    queue<int> q;
    for(int i=1; i<=n; i++)
    {
        int x=v[i];
        if(2*x==a) ans[i]=1;
        if(2*x==b) ans[i]=2;
        if(ans[i]) continue;
        if(x<a && 2*x!=a && m.count(a-x)) opt[i].pb(m[a-x]);
        if(x<b && 2*x!=b && m.count(b-x)) opt[i].pb(m[b-x]);
        if(!opt[i].size()) ok=0;
        if(opt[i].size()==1) q.push(i);
    }
    if(a==b)
    {
        if(n%2 || !ok) ok=0;
        else
        {
            ok=2;
            for(int i=1; i<=n; i++) ans[i]=1;
        }
    }
    while(q.size() && ok==1)
    {
        int cur=q.front();
        q.pop();
        if(ans[cur]) continue;
        int next=opt[cur][0];
        if(ans[next])
        {
            if(opt[cur].size()<2)
            {
                ok=0;
                break;
            }
            else next=opt[cur][1];
            if(ans[next])
            {
                ok=0;
                break;
            }
        }
        if(v[cur]+v[next]==a)
        {
            ans[cur]=1;
            ans[next]=1;
        }
        else
        {
            ans[cur]=2;
            ans[next]=2;
        }
        if(opt[next].size()==2)
        {
            int cur2=opt[next][0]+opt[next][1]-cur;
            if(!ans[cur2])
            {
                if(opt[cur2].size()==1) ok=0;
                else q.push(cur2);
            }
        }
    }
    if(!ok) cout<<"NO\n";
    else
    {
        cout<<"YES\n";
        for(int i=1; i<=n; i++) cout<<ans[i]-1<<" ";
        cout<<"\n";
    }
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

const int INF = 1 << 30;
const double EPS = 1e-12;

int main()
{
    ios_base::sync_with_stdio(0);
    int n, a, b;
    cin>>n>>a>>b;
    map<int, int> m;
    vi v(n+1), ans(n+1,0);
    vector<vi> opt(n+1);
    for(int i =1; i<=n; i++)
    {
        cin>>v[i];
        m[v[i]]=i;
    }
    int ok=1;
    queue<int> q;
    for(int i=1; i<=n; i++)
    {
        int x=v[i];
        if(2*x==a) ans[i]=1;
        if(2*x==b) ans[i]=2;
        if(ans[i]) continue;
        if(x<a && 2*x!=a && m.count(a-x)) opt[i].pb(m[a-x]);
        if(x<b && 2*x!=b && m.count(b-x)) opt[i].pb(m[b-x]);
        if(!opt[i].size()) ok=0;
        if(opt[i].size()==1) q.push(i);
    }
    if(a==b)
    {
        if(ok)
        {
            ok=2;
            for(int i=1; i<=n; i++) ans[i]=1;
        }
    }
    while(q.size() && ok==1)
    {
        int cur=q.front();
        q.pop();
        if(ans[cur]) continue;
        int next=opt[cur][0];
        if(ans[next])
        {
            if(opt[cur].size()<2)
            {
                ok=0;
                break;
            }
            else next=opt[cur][1];
            if(ans[next])
            {
                ok=0;
                break;
            }
        }
        if(v[cur]+v[next]==a)
        {
            ans[cur]=1;
            ans[next]=1;
        }
        else
        {
            ans[cur]=2;
            ans[next]=2;
        }
        if(opt[next].size()==2)
        {
            int cur2=opt[next][0]+opt[next][1]-cur;
            if(!ans[cur2])
            {
                if(opt[cur2].size()==1) ok=0;
                else q.push(cur2);
            }
        }
    }
    if(!ok) cout<<"NO\n";
    else
    {
        cout<<"YES\n";
        for(int i=1; i<=n; i++) cout<<ans[i]-1<<" ";
        cout<<"\n";
    }
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

const int INF = 1 << 30;
const double EPS = 1e-12;

int main()
{
    ios_base::sync_with_stdio(0);
    int n, a, b;
    cin>>n>>a>>b;
    map<int, int> m;
    vi v(n+1), ans(n+1,0);
    vector<vi> opt(n+1);
    for(int i =1; i<=n; i++)
    {
        cin>>v[i];
        m[v[i]]=i;
    }
    int ok=1;
    queue<int> q;
    for(int i=1; i<=n; i++)
    {
        int x=v[i];
        if(x<a  && m.count(a-x)) opt[i].pb(m[a-x]);
        if(x<b  && m.count(b-x)) opt[i].pb(m[b-x]);
        if(!opt[i].size()) ok=0;
        if(opt[i].size()==1) q.push(i);
    }
    if(a==b)
    {
        if(n%2 || !ok) ok=0;
        else
        {
            ok=2;
            for(int i=1; i<=n; i++) ans[i]=1;
        }
    }
    while(q.size() && ok==1)
    {
        int cur=q.front();
        q.pop();
        if(ans[cur]) continue;
        int next=opt[cur][0];
        if(ans[next])
        {
            if(opt[cur].size()<2)
            {
                ok=0;
                break;
            }
            else next=opt[cur][1];
            if(ans[next])
            {
                ok=0;
                break;
            }
        }
        if(v[cur]+v[next]==a)
        {
            ans[cur]=1;
            ans[next]=1;
        }
        else
        {
            ans[cur]=2;
            ans[next]=2;
        }
        if(opt[next].size()==2 && next!=cur)
        {
            int cur2=opt[next][0]+opt[next][1]-cur;
            if(!ans[cur2])
            {
                if(opt[cur2].size()==1) ok=0;
                else q.push(cur2);
            }
        }
    }
    if(!ok) cout<<"NO\n";
    else
    {
        cout<<"YES\n";
        for(int i=1; i<=n; i++) cout<<ans[i]-1<<" ";
        cout<<"\n";
    }
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

const int INF = 1 << 30;
const double EPS = 1e-12;

int main()
{
    ios_base::sync_with_stdio(0);
    int n, a, b;
    cin>>n>>a>>b;
    map<int, int> m;
    vi v(n+1), ans(n+1,0);
    vector<vi> opt(n+1);
    for(int i =1; i<=n; i++)
    {
        cin>>v[i];
        m[v[i]]=i;
    }
    int ok=1;
    queue<int> q;
    for(int i=1; i<=n; i++)
    {
        int x=v[i];
        if(x<a  && m.count(a-x)) opt[i].pb(m[a-x]);
        if(x<b  && m.count(b-x)) opt[i].pb(m[b-x]);
        if(!opt[i].size()) ok=0;
        if(opt[i].size()==1) q.push(i);
    }
    if(a==b)
    {
        if(!ok) ok=0;
        else
        {
            ok=2;
            for(int i=1; i<=n; i++) ans[i]=1;
        }
    }
    while(q.size() && ok==1)
    {
        int cur=q.front();
        q.pop();
        if(ans[cur]) continue;
        int next=opt[cur][0];
        if(ans[next])
        {
            if(opt[cur].size()<2)
            {
                ok=0;
                break;
            }
            else next=opt[cur][1];
            if(ans[next])
            {
                ok=0;
                break;
            }
        }
        if(v[cur]+v[next]==a)
        {
            ans[cur]=1;
            ans[next]=1;
        }
        else
        {
            ans[cur]=2;
            ans[next]=2;
        }
        if(opt[next].size()==2 && next!=cur)
        {
            int cur2=opt[next][0]+opt[next][1]-cur;
            if(!ans[cur2])
            {
                if(opt[cur2].size()==1) ok=0;
                else q.push(cur2);
            }
        }
    }
    if(!ok) cout<<"NO\n";
    else
    {
        cout<<"YES\n";
        for(int i=1; i<=n; i++) cout<<ans[i]-1<<" ";
        cout<<"\n";
    }
}


#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

const int INF = 1 << 30;
const double EPS = 1e-12;

int main()
{
    ios_base::sync_with_stdio(0);
    int n, a, b;
    cin>>n>>a>>b;
    map<int, int> m;
    vi v(n+1), ans(n+1,0);
    vector<vi> opt(n+1);
    for(int i =1; i<=n; i++)
    {
        cin>>v[i];
        m[v[i]]=i;
    }
    int ok=1;
    queue<int> q;
    for(int i=1; i<=n; i++)
    {
        int x=v[i];
        if(x<a && 2*x!=a && m.count(a-x)) opt[i].pb(m[a-x]);
        if(x<b && 2*x!=b && m.count(b-x)) opt[i].pb(m[b-x]);
        if(!opt[i].size()) ok=0;
        if(opt[i].size()==1) q.push(i);
    }
    if(a==b)
    {
        if(n%2 || !ok) ok=0;
        else
        {
            ok=2;
            for(int i=1; i<=n; i++) ans[i]=1;
        }
    }
    while(q.size() && ok==1)
    {
        int cur=q.front();
        q.pop();
        if(ans[cur]) continue;
        int next=opt[cur][0];
        if(ans[next])
        {
            if(opt[cur].size()<2)
            {
                ok=0;
                break;
            }
            else next=opt[cur][1];
        }
        if(v[cur]+v[next]==a)
        {
            ans[cur]=1;
            ans[next]=1;
        }
        else
        {
            ans[cur]=2;
            ans[next]=2;
        }
        if(opt[next].size()==2)
        {
            int cur2=opt[next][0]+opt[next][1]-cur;
            if(!ans[cur2])
            {
                if(opt[cur2].size()==2) ok=0;
                else q.push(cur2);
            }
        }
    }
    if(!ok) cout<<"NO\n";
    else
    {
        cout<<"YES\n";
        for(int i=1; i<=n; i++) cout<<ans[i]-1<<" ";
        cout<<"\n";
    }
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>

#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int >
#define ull unsigned long long
#define pll pair < ll, ll >
#define forit(s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
#define all(s) s.begin(), s.end()

const int inf = (1ll << 31) - 1;

#define MAXN (int) (3e5 + 10)
using namespace std;

int n, a, b;
int c[MAXN], comp[MAXN];
map < int, int> m;
bool used[MAXN];
vector < int > v[MAXN], gr[MAXN], dd;
void top(int g){
    used[g] = 1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) top(v[g][i]);
    dd.pb( g );
}

void dfs(int g, int x){
    comp[g] = x;
    used[g]  =1;
    for(int i = 0; i<gr[g].size(); i++) if( !used[gr[g][i]]) dfs(gr[g][i], x);
}

void dfs2(int g){
    if(used[g]) return;
    used[g]  =1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) dfs2(v[g][i]);
}

int main () {
    #ifdef LOCAL
    freopen ("a.in", "r", stdin);
    freopen ("a.out", "w", stdout);
    #endif

    cin >> n >> a >> b;
    for(int i = 0; i < n; i++) {
        cin >> c[i];
    }
    for(int i = 0; i < n; i++) m[c[i]] = i;

    for(int i = 0; i < n; i++) {
        if( m.count(a-c[i]) == 0&& m.count( b - c[i]) == 0){
            cout << "NO\n";
            return 0;
        }

    }
    if( a==b){
        for(int i = 0; i < n; i++) {
            if( m.count(a-c[i]) == 0){
                cout << "NO\n";
                return 0;
            }
        }
        cout << "YES\n";
        for(int i = 0; i < n; i++) cout << "0 ";
        return 0;
    }
    int k = n * 2;
    for(int i = 0; i < n; i++){
        int j = i * 2;
        if( m.count( a - c[i] ) == 0){
            v[j^1].pb(j);
        }else {
            int k = m[a-c[i]] * 2;
            v[j^1].pb(k ^ 1);
            v[k].pb(j);
        }
        if( m.count( b - c[i] ) == 0){
            v[j].pb(j^1);
        }else {
            int k = m[b-c[i]] * 2;
            v[j].pb(k );
            v[k^1].pb(j^1);
        }
    }

    for(int i = 0; i <= n; i++){
        if( !used[i * 2] ) top(i * 2);
        if( !used[i * 2 + 1] ) top(i * 2 + 1);
    }
    for(int i = 0; i<=n; i++){
        int j = i * 2 + 1;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
        j = i * 2;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
    }
    memset(used, 0, sizeof used);
    int sz = 0;
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs(dd[i-1], sz++);
    }

    for(int i = 0; i <= n; i++){
        if( comp[i * 2] == comp[i*2 + 1] ){
            cout << "NO\n";
            return 0;
        }
    }
    cout << "YES\n";
    memset(used, 0, sizeof used);
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs2(dd[i-1]^1);
    }

    for (int i=0; i<n*2; i+=2) {
        printf ("%d ", used[i]);
    }

    #ifdef LOCAL
    cerr << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>

#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int >
#define ull unsigned long long
#define pll pair < ll, ll >
#define forit(s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
#define all(s) s.begin(), s.end()

const int inf = (1ll << 31) - 1;

#define MAXN (int) (3e5 + 10)
using namespace std;

int n, a, b;
int c[MAXN], comp[MAXN];
map < int, int> m;
bool used[MAXN];
vector < int > v[MAXN], gr[MAXN], dd;
void top(int g){
    used[g] = 1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) top(v[g][i]);
    dd.pb( g );
}

void dfs(int g, int x){
    comp[g] = x;
    used[g]  =1;
    for(int i = 0; i<gr[g].size(); i++) if( !used[gr[g][i]]) dfs(gr[g][i], x);
}

void dfs2(int g){
    if(used[g]) return;
    used[g]  =1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) dfs2(v[g][i]);
}

int main () {
    #ifdef LOCAL
    freopen ("a.in", "r", stdin);
    freopen ("a.out", "w", stdout);
    #endif

    cin >> n >> a >> b;
    for(int i = 0; i < n; i++) {
        cin >> c[i];
    }
    for(int i = 0; i < n; i++) m[c[i]] = i;

    for(int i = 0; i < n; i++) {
        if( m.count(a-c[i]) == 0&& m.count( b - c[i]) == 0){
            cout << "NO\n";
            return 0;
        }

    }
    if( a==b){
        for(int i = 0; i < n; i++) {
            if( m.count(a-c[i]) == 0){
                cout << "NO\n";
                return 0;
            }
        }
        cout << "YES\n";
        for(int i = 0; i < n; i++) cout << "0 ";
        return 0;
    }
    int k = n * 2;
    for(int i = 0; i < n; i++){
        int j = i * 2;
        if( m.count( a - c[i] ) == 0){
            v[j^1].pb(k ^ 1);
            v[k^1].pb(j^1);
        }else {
            int k = m[a-c[i]] * 2;
            v[j^1].pb(k ^ 1);
            v[k^1].pb(j^1);
        }
        if( m.count( b - c[i] ) == 0){
            v[j].pb(k);
            v[k].pb(j);
        }else {
            int k = m[b-c[i]] * 2;
            v[j].pb(k );
            v[k].pb(j);
        }
    }

    for(int i = 0; i <= n; i++){
        if( !used[i * 2] ) top(i * 2);
        if( !used[i * 2 + 1] ) top(i * 2 + 1);
    }
    for(int i = 0; i<=n; i++){
        int j = i * 2 + 1;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
        j = i * 2;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
    }
    memset(used, 0, sizeof used);
    int sz = 0;
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs(dd[i-1], sz++);
    }

    for(int i = 0; i <= n; i++){
        if( comp[i * 2] == comp[i*2 + 1] ){
            cout << "NO\n";
        }
    }
    cout << "YES\n";
    memset(used, 0, sizeof used);
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs2(dd[i-1]);
    }

    for (int i=0; i<n*2; i+=2) {
        printf ("%d ", used[i]);
    }

    #ifdef LOCAL
    cerr << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>

#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int >
#define ull unsigned long long
#define pll pair < ll, ll >
#define forit(s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
#define all(s) s.begin(), s.end()

const int inf = (1ll << 31) - 1;

#define MAXN (int) (3e5 + 10)
using namespace std;

int n, a, b;
int c[MAXN], comp[MAXN];
map < int, int> m;
bool used[MAXN];
vector < int > v[MAXN], gr[MAXN], dd;
void top(int g){
    used[g] = 1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) top(v[g][i]);
    dd.pb( g );
}

void dfs(int g, int x){
    comp[g] = x;
    used[g]  =1;
    for(int i = 0; i<gr[g].size(); i++) if( !used[gr[g][i]]) dfs(gr[g][i], x);
}

int main () {
    #ifdef LOCAL
    freopen ("a.in", "r", stdin);
    freopen ("a.out", "w", stdout);
    #endif

    cin >> n >> a >> b;
    for(int i = 0; i < n; i++) {
        cin >> c[i];
    }
    for(int i = 0; i < n; i++) m[c[i]] = i;

    for(int i = 0; i < n; i++) {
        if( m.count(a-c[i]) == 0&& m.count( b - c[i]) == 0){
            cout << "NO\n";
            return 0;
        }

    }
    if( a==b){
        for(int i = 0; i < n; i++) {
            if( m.count(a-c[i]) == 0){
                cout << "NO\n";
                return 0;
            }
        }
        cout << "YES\n";
        for(int i = 0; i < n; i++) cout << "0 ";
        return 0;
    }
    int k = n * 2;
    for(int i = 0; i < n; i++){
        int j = i * 2;
        if( m.count( a - c[i] ) == 0){
            v[j^1].pb(k ^ 1);
            v[k^1].pb(j^1);
        }else {
            int k = m[a-c[i]] * 2;
            v[j^1].pb(k ^ 1);
            v[k^1].pb(j^1);
        }
        if( m.count( b - c[i] ) == 0){
            v[j].pb(k);
            v[k].pb(j);
        }else {
            int k = m[b-c[i]] * 2;
            v[j].pb(k );
            v[k].pb(j);
        }
    }

    for(int i = 0; i <= n; i++){
        if( !used[i * 2] ) top(i * 2);
        if( !used[i * 2 + 1] ) top(i * 2 + 1);
    }
    for(int i = 0; i<=n; i++){
        int j = i * 2 + 1;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
        j = i * 2;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
    }
    memset(used, 0, sizeof used);
    int sz = 0;
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs(dd[i-1], sz++);
    }

    for(int i = 0; i <= n; i++){
        if( comp[i * 2] == comp[i*2 + 1] ){
            cout << "NO\n";
        }
    }
    cout << "YES\n";
    for (int i=0; i<n; ++i) {
        int ans = comp[i] > comp[i^1] ? i : i^1;
        printf ("%d ", (ans > 0));
    }

    #ifdef LOCAL
    cerr << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>

#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int >
#define ull unsigned long long
#define pll pair < ll, ll >
#define forit(s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
#define all(s) s.begin(), s.end()

const int inf = (1ll << 31) - 1;

#define MAXN (int) (3e5 + 10)
using namespace std;

int n, a, b;
int c[MAXN], comp[MAXN], tt[MAXN];
map < int, int> m;
bool used[MAXN];
vector < int > v[MAXN], gr[MAXN], dd;
void top(int g){
    used[g] = 1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) top(v[g][i]);
    dd.pb( g );
}

void dfs(int g, int x){
    comp[g] = x;
    used[g]  =1;
    for(int i = 0; i<gr[g].size(); i++) if( !used[gr[g][i]]) dfs(gr[g][i], x);
}

void dfs2(int g){
    if(used[g]) return;
    used[g] = 1;
    tt[g]  = g;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) dfs2(v[g][i]);
}

int main () {
    #ifdef LOCAL
    freopen ("a.in", "r", stdin);
    freopen ("a.out", "w", stdout);
    #endif

    cin >> n >> a >> b;
    for(int i = 0; i < n; i++) {
        cin >> c[i];
    }
    for(int i = 0; i < n; i++) m[c[i]] = i;

    for(int i = 0; i < n; i++) {
        if( m.count(a-c[i]) == 0&& m.count( b - c[i]) == 0){
            cout << "NO\n";
            return 0;
        }

    }
    if( a==b){
        for(int i = 0; i < n; i++) {
            if( m.count(a-c[i]) == 0){
                cout << "NO\n";
                return 0;
            }
        }
        cout << "YES\n";
        for(int i = 0; i < n; i++) cout << "0 ";
        return 0;
    }
    int k = n * 2;
    for(int i = 0; i < n; i++){
        int j = i * 2;
        if( m.count( a - c[i] ) == 0){

            v[j^1].pb(j);
        }else {
            int k = m[a-c[i]] * 2;
            v[j^1].pb(k ^ 1);
            v[k].pb(j);
        }
        if( m.count( b - c[i] ) == 0){
            v[j].pb(j^1);
        }else {
            int k = m[b-c[i]] * 2;
            v[j].pb(k);
            v[k^1].pb(j^1);
        }
    }

    for(int i = 0; i < n; i++){
        if( !used[i * 2] ) top(i * 2);
        if( !used[i * 2 + 1] ) top(i * 2 + 1);
    }
    for(int i = 0; i<n; i++){
        int j = i * 2 + 1;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
        j = i * 2;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
    }
    memset(used, 0, sizeof used);
    int sz = 0;
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs(dd[i-1], sz++);
    }

    for(int i = 0; i < n; i++){
        if( comp[i * 2] == comp[i*2 + 1] ){
            cout << "NO\n";
            return 0;
        }
    }
    cout << "YES\n";
    memset(used, 0, sizeof used);
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs2(dd[i-1]^1);
    }
    for (int i=0; i<n*2; i += 2) {
        cout << used[i]  << " ";
    }

    #ifdef LOCAL
    cerr << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>

#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int >
#define ull unsigned long long
#define pll pair < ll, ll >
#define forit(s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
#define all(s) s.begin(), s.end()

const int inf = (1ll << 31) - 1;

#define MAXN (int) (3e5 + 10)
using namespace std;

int n, a, b;
int c[MAXN], comp[MAXN];
map < int, int> m;
bool used[MAXN];
vector < int > v[MAXN], gr[MAXN], dd;
void top(int g){
    used[g] = 1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) top(v[g][i]);
    dd.pb( g );
}

void dfs(int g, int x){
    comp[g] = x;
    used[g]  =1;
    for(int i = 0; i<gr[g].size(); i++) if( !used[gr[g][i]]) dfs(gr[g][i], x);
}

int main () {
    #ifdef LOCAL
    freopen ("a.in", "r", stdin);
    freopen ("a.out", "w", stdout);
    #endif

    cin >> n >> a >> b;
    for(int i = 0; i < n; i++) {
        cin >> c[i];
    }
    for(int i = 0; i < n; i++) m[c[i]] = i;

    for(int i = 0; i < n; i++) {
        if( m.count(a-c[i]) == 0&& m.count( b - c[i]) == 0){
            cout << "NO\n";
            return 0;
        }

    }
    if( a==b){
        for(int i = 0; i < n; i++) {
            if( m.count(a-c[i]) == 0){
                cout << "NO\n";
                return 0;
            }
        }
        cout << "YES\n";
        for(int i = 0; i < n; i++) cout << "0 ";
        return 0;
    }
    int k = n * 2;
    for(int i = 0; i < n; i++){
        int j = i * 2;
        if( m.count( a - c[i] ) == 0){
            v[j^1].pb(k ^ 1);
            v[k^1].pb(j^1);
        }else {
            int k = m[a-c[i]] * 2;
            v[j^1].pb(k ^ 1);
            v[k^1].pb(j^1);
        }
        if( m.count( b - c[i] ) == 0){
            v[j].pb(k);
            v[k].pb(j);
        }else {
            int k = m[b-c[i]] * 2;
            v[j].pb(k );
            v[k].pb(j);
        }
    }

    for(int i = 0; i <= n; i++){
        if( !used[i * 2] ) top(i * 2);
        if( !used[i * 2 + 1] ) top(i * 2 + 1);
    }
    for(int i = 0; i<=n; i++){
        int j = i * 2 + 1;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( v[j][t] );
        }
        j = i * 2;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( v[j][t] );
        }
    }
    memset(used, 0, sizeof used);
    int sz = 0;
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs(dd[i-1], sz++);
    }

    for(int i = 0; i <= n; i++){
        if( comp[i * 2] == comp[i*2 + 1] ){
            cout << "NO\n";
        }
    }
    cout << "YES\n";
    for (int i=0; i<n; ++i) {
        int ans = comp[i] > comp[i^1] ? i : i^1;
        printf ("%d ", (ans > 0));
    }

    #ifdef LOCAL
    cerr << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>

#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int >
#define ull unsigned long long
#define pll pair < ll, ll >
#define forit(s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
#define all(s) s.begin(), s.end()

const int inf = (1ll << 31) - 1;

#define MAXN (int) (3e5 + 10)
using namespace std;

int n, a, b;
int c[MAXN], comp[MAXN];
map < int, int> m;
bool used[MAXN];
vector < int > v[MAXN], gr[MAXN], dd;
void top(int g){
    used[g] = 1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) top(v[g][i]);
    dd.pb( g );
}

void dfs(int g, int x){
    comp[g] = x;
    used[g]  =1;
    for(int i = 0; i<gr[g].size(); i++) if( !used[gr[g][i]]) dfs(gr[g][i], x);
}

int main () {
    #ifdef LOCAL
    freopen ("a.in", "r", stdin);
    freopen ("a.out", "w", stdout);
    #endif

    cin >> n >> a >> b;
    for(int i = 0; i < n; i++) {
        cin >> c[i];
    }
    for(int i = 0; i < n; i++) m[c[i]] = i;

    for(int i = 0; i < n; i++) {
        if( m.count(a-c[i]) == 0&& m.count( b - c[i]) == 0){
            cout << "NO\n";
            return 0;
        }

    }
    if( a==b){
        for(int i = 0; i < n; i++) {
            if( m.count(a-c[i]) == 0){
                cout << "NO\n";
                return 0;
            }
        }
        cout << "YES\n";
        for(int i = 0; i < n; i++) cout << "0 ";
        return 0;
    }
    int k = n * 2;
    for(int i = 0; i < n; i++){
        int j = i * 2;
        if( m.count( a - c[i] ) == 0){
            v[j^1].pb(k ^ 1);
            v[k^1].pb(j^1);
        }else {
            int k = m[a-c[i]] * 2;
            v[j^1].pb(k ^ 1);
            v[k^1].pb(j^1);
        }
        if( m.count( b - c[i] ) == 0){
            v[j].pb(k);
            v[k].pb(j);
        }else {
            int k = m[b-c[i]] * 2;
            v[j].pb(k );
            v[k].pb(j);
        }
    }

    for(int i = 0; i <= n; i++){
        if( !used[i * 2] ) top(i * 2);
        if( !used[i * 2 + 1] ) top(i * 2 + 1);
    }
    for(int i = 0; i<=n; i++){
        int j = i * 2 + 1;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( v[j][t] );
        }
        j = i * 2;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( v[j][t] );
        }
    }
    memset(used, 0, sizeof used);
    int sz = 0;
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs(dd[i-1], sz++);
    }

    for(int i = 0; i <= n; i++){
        if( comp[i * 2] == comp[i*2 + 1] ){
            cout << "NO\n";
        }
    }
    for (int i=0; i<n; ++i) {
        int ans = comp[i] > comp[i^1] ? i : i^1;
        printf ("%d ", (ans > 0));
    }

    #ifdef LOCAL
    cerr << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>

#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int >
#define ull unsigned long long
#define pll pair < ll, ll >
#define forit(s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
#define all(s) s.begin(), s.end()

const int inf = (1ll << 31) - 1;

#define MAXN (int) (3e5 + 10)
using namespace std;

int n, a, b;
int c[MAXN], comp[MAXN];
map < int, int> m;
bool used[MAXN];
vector < int > v[MAXN], gr[MAXN], dd;
void top(int g){
    used[g] = 1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) top(v[g][i]);
    dd.pb( g );
}

void dfs(int g, int x){
    comp[g] = x;
    used[g]  =1;
    for(int i = 0; i<gr[g].size(); i++) if( !used[gr[g][i]]) dfs(gr[g][i], x);
}

void dfs2(int g){
    if(used[g]) return;
    used[g]  =1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) dfs2(v[g][i]);
}

int main () {
    #ifdef LOCAL
    freopen ("a.in", "r", stdin);
    freopen ("a.out", "w", stdout);
    #endif

    cin >> n >> a >> b;
    for(int i = 0; i < n; i++) {
        cin >> c[i];
    }
    for(int i = 0; i < n; i++) m[c[i]] = i;

    for(int i = 0; i < n; i++) {
        if( m.count(a-c[i]) == 0&& m.count( b - c[i]) == 0){
            cout << "NO\n";
            return 0;
        }

    }
    if( a==b){
        for(int i = 0; i < n; i++) {
            if( m.count(a-c[i]) == 0){
                cout << "NO\n";
                return 0;
            }
        }
        cout << "YES\n";
        for(int i = 0; i < n; i++) cout << "0 ";
        return 0;
    }
    int k = n * 2;
    for(int i = 0; i < n; i++){
        int j = i * 2;
        if( m.count( a - c[i] ) == 0){
            v[j^1].pb(k ^ 1);
            v[k^1].pb(j^1);
        }else {
            int k = m[a-c[i]] * 2;
            v[j^1].pb(k ^ 1);
            v[k^1].pb(j^1);
        }
        if( m.count( b - c[i] ) == 0){
            v[j].pb(k);
            v[k].pb(j);
        }else {
            int k = m[b-c[i]] * 2;
            v[j].pb(k );
            v[k].pb(j);
        }
    }

    for(int i = 0; i <= n; i++){
        if( !used[i * 2] ) top(i * 2);
        if( !used[i * 2 + 1] ) top(i * 2 + 1);
    }
    for(int i = 0; i<=n; i++){
        int j = i * 2 + 1;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
        j = i * 2;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
    }
    memset(used, 0, sizeof used);
    int sz = 0;
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs(dd[i-1], sz++);
    }

    for(int i = 0; i <= n; i++){
        if( comp[i * 2] == comp[i*2 + 1] ){
            cout << "NO\n";
        }
    }
    cout << "YES\n";
    memset(used, 0, sizeof used);
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs2(dd[i-1]^1);
    }

    for (int i=0; i<n*2; i+=2) {
        printf ("%d ", used[i]);
    }

    #ifdef LOCAL
    cerr << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>

#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#define s second
#define pii pair < int, int >
#define ull unsigned long long
#define pll pair < ll, ll >
#define forit(s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
#define all(s) s.begin(), s.end()

const int inf = (1ll << 31) - 1;

#define MAXN (int) (3e5 + 10)
using namespace std;

int n, a, b;
int c[MAXN], comp[MAXN];
map < int, int> m;
bool used[MAXN];
vector < int > v[MAXN], gr[MAXN], dd;
void top(int g){
    used[g] = 1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) top(v[g][i]);
    dd.pb( g );
}

void dfs(int g, int x){
    comp[g] = x;
    used[g]  =1;
    for(int i = 0; i<gr[g].size(); i++) if( !used[gr[g][i]]) dfs(gr[g][i], x);
}

void dfs2(int g){
    if(used[g]) return;
    used[g]  =1;
    for(int i = 0; i<v[g].size(); i++) if( !used[v[g][i]]) dfs2(v[g][i]);
}

int main () {
    #ifdef LOCAL
    freopen ("a.in", "r", stdin);
    freopen ("a.out", "w", stdout);
    #endif

    cin >> n >> a >> b;
    for(int i = 0; i < n; i++) {
        cin >> c[i];
    }
    for(int i = 0; i < n; i++) m[c[i]] = i;

    for(int i = 0; i < n; i++) {
        if( m.count(a-c[i]) == 0&& m.count( b - c[i]) == 0){
            cout << "NO\n";
            return 0;
        }

    }
    if( a==b){
        for(int i = 0; i < n; i++) {
            if( m.count(a-c[i]) == 0){
                cout << "NO\n";
                return 0;
            }
        }
        cout << "YES\n";
        for(int i = 0; i < n; i++) cout << "0 ";
        return 0;
    }
    int k = n * 2;
    for(int i = 0; i < n; i++){
        int j = i * 2;
        if( m.count( a - c[i] ) == 0){
            v[j^1].pb(j);
        }else {
            int k = m[a-c[i]] * 2;
            v[j^1].pb(k ^ 1);
            v[k].pb(j);
        }
        if( m.count( b - c[i] ) == 0){
            v[j].pb(j^1);
        }else {
            int k = m[b-c[i]] * 2;
            v[j].pb(k );
            v[k^1].pb(j^1);
        }
    }

    for(int i = 0; i <= n; i++){
        if( !used[i * 2] ) top(i * 2);
        if( !used[i * 2 + 1] ) top(i * 2 + 1);
    }
    for(int i = 0; i<=n; i++){
        int j = i * 2 + 1;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
        j = i * 2;
        for(int t = 0; t < v[j].size(); t++){
            gr[v[j][t]].pb( j );
        }
    }
    memset(used, 0, sizeof used);
    int sz = 0;
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs(dd[i-1], sz++);
    }

    for(int i = 0; i <= n; i++){
        if( comp[i * 2] == comp[i*2 + 1] ){
            cout << "NO\n";
        }
    }
    cout << "YES\n";
    memset(used, 0, sizeof used);
    for(int i = dd.size(); i>0; i--){
        if(!used[dd[i-1]]) dfs2(dd[i-1]^1);
    }

    for (int i=0; i<n*2; i+=2) {
        printf ("%d ", used[i]);
    }

    #ifdef LOCAL
    cerr << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    #endif
    return 0;
}


#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:66777216")
#include <iostream>
#include <cmath>
#include <vector>
#include <time.h>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>
#include <cstdio>
#include <cstdlib>
#include <bitset>
#include <algorithm>
#include <string>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
#define mk make_pair
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define fornn(i, q, n) for(ll i = (ll)q; i < (ll)n; i++)
#define times clock() * 1.0 / CLOCKS_PER_SEC

const ll inf = 1e15 + 7;
const ll dd = 5e5 + 7;
const ll mod = 1e9 + 7;
const ll p1 = 131797;
const ll p2 = 435493969;

vector<int> R, P, B;
vector<bool> is;
map<int, int> W;
ll a, b, n;

void omg(){
	cout<<"NO";
	exit(0);
}

void dfs(int v, bool bs){
	if(W.find(v) == W.end())
		return;
	if(is[W[v]]){
		if(R[W[v]] != (bs ? 1 : -1) && !R[W[v]] == 0)
			omg();
		return;
	}
	is[W[v]] = 1;
	if(bs){
		if(W.find(a - v) == W.end())
			omg();
		R[W[v]] = R[W[a - v]] = 1, dfs(b - a + v, bs);
	}
	else{
		if(W.find(b - v) == W.end())
			omg();
		R[W[v]] = R[W[b - v]] = -1, dfs(a - b + v, bs);
	}
}

int main(){
	ios_base::sync_with_stdio(0);
	srand(time(0));

	cin>>n>>a>>b;
	is.resize(n);
	forn(i, n){
		int t;
		cin>>t;
		P.push_back(t);
		W[t] = i;
	}
	sort(P.begin(), P.end());
	R.resize(n);
	for(auto t : W){
		if(W.find(a - t.first) != W.end() && W.find(b - t.first) != W.end())
			R[t.second] = 0;
		else
			if(W.find(a - t.first) != W.end())
				R[t.second] = 1;
		else
			if(W.find(b - t.first) != W.end())
				R[t.second] = -1;
		else
			omg();
	}
	forn(i, n)
		if(R[i])
			dfs(P[i], R[i] > 0);
	cout<<"YES\n";
	forn(i, n)
		cout<<(R[i] < 0)<<' ';

}


#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:66777216")
#include <iostream>
#include <cmath>
#include <vector>
#include <time.h>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>
#include <cstdio>
#include <cstdlib>
#include <bitset>
#include <algorithm>
#include <string>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
#define mk make_pair
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define fornn(i, q, n) for(ll i = (ll)q; i < (ll)n; i++)
#define times clock() * 1.0 / CLOCKS_PER_SEC

const ll inf = 1e15 + 7;
const ll dd = 5e5 + 7;
const ll mod = 1e9 + 7;
const ll p1 = 131797;
const ll p2 = 435493969;

vector<int> R, P;
map<int, int> W;
int main(){
	ios_base::sync_with_stdio(0);
	srand(time(0));

	ll a, b, n;
	cin>>n>>a>>b;
	forn(i, n){
		int t;
		cin>>t;
		P.push_back(t);
		W[t] = i;
	}
	R.resize(n);
	forn(i, n){
		if(W.empty())
			break;
		int c = P[i];
		bool q = W.find(a - c) != W.end(), w = W.find(b - c) != W.end();
		if(q ^ w)
			R[W[c]] = R[W[(q ? a : b) - c]] = w, W.erase(c), W.erase((q ? a : b) - c);
		if(!(q || w)){
			cout<<"NO";
			return 0;
		}
	}
	for(auto t : W)
		if(W.find(a - t.first) == W.end() || W.find(b - t.first) == W.end()){
			cout<<"NO";
			return 0;
		}
	for(auto t : W)
		R[t.second] = 1;
	cout<<"YES\n";
	forn(i, n)
		cout<<R[i]<<' ';

}


#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:66777216")
#include <iostream>
#include <cmath>
#include <vector>
#include <time.h>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>
#include <cstdio>
#include <cstdlib>
#include <bitset>
#include <algorithm>
#include <string>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
#define mk make_pair
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define fornn(i, q, n) for(ll i = (ll)q; i < (ll)n; i++)
#define times clock() * 1.0 / CLOCKS_PER_SEC

const ll inf = 1e15 + 7;
const ll dd = 5e5 + 7;
const ll mod = 1e9 + 7;
const ll p1 = 131797;
const ll p2 = 435493969;

vector<int> R, P;
map<int, int> W;
int main(){
	ios_base::sync_with_stdio(0);
	srand(time(0));

	ll a, b, n;
	cin>>n>>a>>b;
	forn(i, n){
		int t;
		cin>>t;
		P.push_back(t);
		W[t] = i;
	}
	sort(P.begin(), P.end());
	R.resize(n);
	forn(i, n){
		if(W.empty())
			break;
		int c = P[i];
		if(W.find(c) == W.end())
			continue;
		bool q = W.find(a - c) != W.end(), w = W.find(b - c) != W.end();
		if(q ^ w)
			R[W[c]] = R[W[(q ? a : b) - c]] = w, W.erase(c), W.erase((q ? a : b) - c);
		if(!(q || w)){
			cout<<"NO";
			return 0;
		}
	}
	for(auto t : W){
		bool e = W.find(a - t.first) != W.end(), r = W.find(b - t.first) != W.end();
		if(!e || !r){
			cout<<"NO";
			return 0;
		}
	}
	for(auto t : W)
		R[t.second] = 1;
	cout<<"YES\n";
	forn(i, n)
		cout<<R[i]<<' ';

}


#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:66777216")
#include <iostream>
#include <cmath>
#include <vector>
#include <time.h>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>
#include <cstdio>
#include <cstdlib>
#include <bitset>
#include <algorithm>
#include <string>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
#define mk make_pair
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define fornn(i, q, n) for(ll i = (ll)q; i < (ll)n; i++)
#define times clock() * 1.0 / CLOCKS_PER_SEC

const ll inf = 1e15 + 7;
const ll dd = 5e5 + 7;
const ll mod = 1e9 + 7;
const ll p1 = 131797;
const ll p2 = 435493969;

vector<int> R, P, B;
vector<bool> is;
map<int, int> W;
ll a, b, n;

void omg(){
	cout<<"NO";
	exit(0);
}

void dfs(int v, bool bs){
	if(W.find(v) == W.end())
		return;
	if(is[W[v]]){
		if(R[W[v]] != (bs ? 1 : -1) && !R[W[v]] == 0)
			omg();
		return;
	}
	is[W[v]] = 1;
	if(bs){
		if(W.find(a - v) == W.end())
			omg();
		R[W[v]] = R[W[a - v]] = 1, dfs(b - a + v, bs);
	}
	else{
		if(W.find(b - v) == W.end())
			omg();
		R[W[v]] = R[W[b - v]] = -1, dfs(a - b + v, bs);
	}
}

int main(){
	ios_base::sync_with_stdio(0);
	srand(time(0));

	cin>>n>>a>>b;
	is.resize(n);
	forn(i, n){
		int t;
		cin>>t;
		P.push_back(t);
		W[t] = i;
	}
	R.resize(n);
	for(auto t : W){
		if(W.find(a - t.first) != W.end() && W.find(b - t.first) != W.end())
			R[t.second] = 0;
		else
			if(W.find(a - t.first) != W.end())
				R[t.second] = 1;
		else
			if(W.find(b - t.first) != W.end())
				R[t.second] = -1;
		else
			omg();
	}
	forn(i, n)
		if(R[i])
			dfs(P[i], R[i] > 0);
	cout<<"YES\n";
	forn(i, n)
		cout<<(R[i] < 0)<<' ';

}


#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:66777216")
#include <iostream>
#include <cmath>
#include <vector>
#include <time.h>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>
#include <cstdio>
#include <cstdlib>
#include <bitset>
#include <algorithm>
#include <string>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
#define mk make_pair
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define fornn(i, q, n) for(ll i = (ll)q; i < (ll)n; i++)
#define times clock() * 1.0 / CLOCKS_PER_SEC

const ll inf = 1e15 + 7;
const ll dd = 5e5 + 7;
const ll mod = 1e9 + 7;
const ll p1 = 131797;
const ll p2 = 435493969;

vector<int> R, P;
map<int, int> W;
int main(){
	ios_base::sync_with_stdio(0);
	srand(time(0));

	ll a, b, n;
	cin>>n>>a>>b;
	forn(i, n){
		int t;
		cin>>t;
		P.push_back(t);
		W[t] = i;
	}
	R.resize(n);
	forn(i, n){
		if(W.empty())
			break;
		int c = P[i];
		if(W.find(c) == W.end())
			continue;
		bool q = W.find(a - c) != W.end(), w = W.find(b - c) != W.end();
		if(q ^ w)
			R[W[c]] = R[W[(q ? a : b) - c]] = w, W.erase(c), W.erase((q ? a : b) - c);
		if(!(q || w)){
			cout<<"NO";
			return 0;
		}
	}
	for(auto t : W)
		if(W.find(a - t.first) == W.end() || W.find(b - t.first) == W.end()){
			cout<<"NO";
			return 0;
		}
	for(auto t : W)
		R[t.second] = 1;
	cout<<"YES\n";
	forn(i, n)
		cout<<R[i]<<' ';

}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <assert.h>
#include <stdio.h>
#include <ctime>
#include <cstdlib>
#include <utility>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>

#define inf (999999999)
#define pii pair<int,int>
#define pip pair<int,pii>
#define pll pair<unsigned long long,unsigned long long>
#define eps 1e-8

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

#define pb push_back
#define mod 1000000007
#define maxn 100100

using namespace std;

vector<int> L[100100];
int ans[100100];
int foi[100100];
long long v[100100];

int imp = 0;
long long a,b;

void dfs(int x,int liga){

	foi[x] = 1;
	int foi2 = 0;

	for(vector<int> :: iterator it = L[x].begin(); it < L[x].end(); it++) if(!foi[*it]){

		if(liga){
			if(b-v[x] == v[*it] || b-v[*it] == v[x])
				ans[x] = ans[*it] = 1;
			else assert(a-v[x] == v[*it] || a-v[*it] == v[x]);
		}
		dfs(*it,1-liga);
		foi2++;

	}

	if(foi2 == 0 && liga == 1)
		imp = 1;

}

main(){

		int n;
		scanf("%d%I64d%I64d",&n,&a,&b);

		map<int,int> mp;

		for(int i=0;i<n;i++){
			scanf("%I64d",v+i);
			assert(mp.find(v[i]) == mp.end());
			mp[v[i]] = i;
		}

		for(int i=0;i<n;i++){
			if(mp.find(a-v[i]) != mp.end()) if(2*v[i] != a)
				L[i].pb(mp[a-v[i]]);
			if(mp.find(b-v[i]) != mp.end()) if(2*v[i] != b)
				L[i].pb(mp[b-v[i]]);
		}

		for(int i=0;i<n;i++) if(!foi[i])
			dfs(i,1);

		if(imp)
			printf("NO\n");
		else {
			printf("YES\n");
			for(int i=0;i<n;i++)
				printf("%d ",ans[i]);
			printf("\n");
		}

}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <assert.h>
#include <stdio.h>
#include <ctime>
#include <cstdlib>
#include <utility>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>

#define inf (999999999)
#define pii pair<int,int>
#define pip pair<int,pii>
#define pll pair<unsigned long long,unsigned long long>
#define eps 1e-8

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

#define pb push_back
#define mod 1000000007
#define maxn 100100

using namespace std;

vector<int> L[100100];
int ans[100100];
int foi[100100];
long long v[100100];

int imp = 0;
long long a,b;

void dfs(int x,int liga){

	foi[x] = 1;
	int foi2 = 0;

	for(vector<int> :: iterator it = L[x].begin(); it < L[x].end(); it++) if(!foi[*it]){

		if(liga){
			if(b-v[x] == v[*it] || b-v[*it] == v[x])
				ans[x] = ans[*it] = 1;
			else assert(a-v[x] == v[*it] || a-v[*it] == v[x]);
		}
		dfs(*it,1-liga);
		foi2++;

	}

	if(foi2 == 0 && liga == 1)
		imp = 1;

}

main(){

		int n;
		scanf("%d%I64d%I64d",&n,&a,&b);

		map<int,int> mp;

		for(int i=0;i<n;i++){
			scanf("%I64d",v+i);
			assert(mp.find(v[i]) == mp.end());
			mp[v[i]] = i;
		}

		for(int i=0;i<n;i++){
			if(mp.find(a-v[i]) != mp.end())
				L[i].pb(mp[a-v[i]]);
			if(mp.find(b-v[i]) != mp.end())
				L[i].pb(mp[b-v[i]]);
		}

		for(int i=0;i<n;i++) if(!foi[i])
			dfs(i,1);

		if(imp)
			printf("NO\n");
		else {
			printf("YES\n");
			for(int i=0;i<n;i++)
				printf("%d ",ans[i]);
			printf("\n");
		}

}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <assert.h>
#include <stdio.h>
#include <ctime>
#include <cstdlib>
#include <utility>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>

#define inf (999999999)
#define pii pair<int,int>
#define pip pair<int,pii>
#define pll pair<unsigned long long,unsigned long long>
#define eps 1e-8

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

#define pb push_back
#define mod 1000000007
#define maxn 100100

using namespace std;

vector<int> L[100100];
int ans[100100];
int foi[100100];
long long v[100100];

int imp = 0;
long long a,b;

void dfs(int x,int liga){

    foi[x] = 1;
    int foi2 = 0;

    for(vector<int> :: iterator it = L[x].begin(); it < L[x].end(); it++) if(!foi[*it]){

        if(liga){
            if(b-v[x] == v[*it] || b-v[*it] == v[x])
                ans[x] = ans[*it] = 1;
            else assert(a-v[x] == v[*it] || a-v[*it] == v[x]);
        }
        dfs(*it,1-liga);
        foi2++;

    }

    if(foi2 == 0 && liga == 1)
        imp = 1;

}

int pai[100100];
int qnt[100100];
int find(int x){
    return pai[x] = (x==pai[x])?x:find(pai[x]);}
void merge(int a,int b){
    a = pai[a];
    b = pai[b];
    qnt[a] += qnt[b];
    pai[b] = a;
}

main(){

        int n;
        scanf("%d%I64d%I64d",&n,&a,&b);

        for(int i=0;i<n;i++)
            pai[i] = i, qnt[i] = 1;

        map<int,int> mp;

        for(int i=0;i<n;i++){
            scanf("%I64d",v+i);
            assert(mp.find(v[i]) == mp.end());
            mp[v[i]] = i;
        }

        int A = -1, B = -1;

        for(int i=0;i<n;i++){
            if(2*v[i] == a) A = i;
            if(2*v[i] == b) B = i;
            if(mp.find(a-v[i]) != mp.end()) if(2*v[i] != a){
                L[i].pb(mp[a-v[i]]); merge(i,mp[a-v[i]]);}
            if(mp.find(b-v[i]) != mp.end()) if(2*v[i] != b){
                L[i].pb(mp[b-v[i]]); merge(i,mp[b-v[i]]);}
        }

        if(A+1 && B+1){
            if(qnt[find(A)]%2 == 1){
                foi[A] = 1;
                if(find(A) != find(B) && qnt[find(A)]%2 == 1){
                    foi[B] = 1; ans[B] = 1;}
            }
            else if(qnt[find(B)]%2 == 1){
                foi[B] = 1;
                ans[B] = 1;
            }
        }
        else if(A+1){
            if(qnt[find(A)]%2 == 1) foi[A] = 1;}
        else if(B+1){
            if(qnt[find(B)]%2 == 1){
                foi[B] = 1;
                ans[B] = 1;
            }
        }

        for(int i=0;i<n;i++) if(!foi[i] && L[i].size() == 1)
            dfs(i,1);

        for(int i=0;i<n;i++) if(!foi[i])
            dfs(i,1);

        if(imp)
            printf("NO\n");
        else {
            printf("YES\n");
            for(int i=0;i<n;i++)
                printf("%d ",ans[i]);
            printf("\n");
        }

}


#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <assert.h>
#include <stdio.h>
#include <ctime>
#include <cstdlib>
#include <utility>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>

#define inf (999999999)
#define pii pair<int,int>
#define pip pair<int,pii>
#define pll pair<unsigned long long,unsigned long long>
#define eps 1e-8

#ifdef ONLINE_JUDGE
#define debug(args...)
#else
#define debug(args...) fprintf(stderr,args)
#endif

#define pb push_back
#define mod 1000000007
#define maxn 100100

using namespace std;

vector<int> L[100100];
int ans[100100];
int foi[100100];
int v[100100];

int imp = 0;
int a,b;

void dfs(int x,int liga){

	foi[x] = 1;
	int foi2 = 0;

	for(vector<int> :: iterator it = L[x].begin(); it < L[x].end(); it++) if(!foi[*it]){

		if(liga){
			if(b-v[x] == v[*it] || b-v[*it] == v[x])
				ans[x] = ans[*it] = 1;
		}
		dfs(*it,1-liga);
		foi2++;

	}

	if(foi2 == 0 && liga == 1)
		imp = 1;

}

main(){

		int n;
		scanf("%d%d%d",&n,&a,&b);

		map<int,int> mp;

		for(int i=0;i<n;i++){
			scanf("%d",v+i);
			mp[v[i]] = i;
		}

		for(int i=0;i<n;i++){
			if(mp.find(a-v[i]) != mp.end())
				L[i].pb(mp[a-v[i]]);
			if(mp.find(b-v[i]) != mp.end())
				L[i].pb(mp[b-v[i]]);
		}

		for(int i=0;i<n;i++) if(!foi[i])
			dfs(i,1);

		if(imp)
			printf("NO\n");
		else {
			printf("YES\n");
			for(int i=0;i<n;i++)
				printf("%d ",ans[i]);
			printf("\n");
		}

}