#include <bits/stdc++.h>

using namespace std;

const int N = 5e5 + 1;
const int inf = N + 1;
int a[N];
vector <int> cnt;
vector <vector <int>> pos;

vector <int> cycle;

struct edge {
    int u, v, f, c;
};

vector <edge> e;
vector <int> g[N];
int sz = 0, d[N], s, t, ptr[N];

void add (int u, int v, int c) {
    g[u].push_back(e.size());
    e.push_back({u, v, 0, c});
    g[v].push_back(e.size());
    e.push_back({v, u, 0, 0});
}

int create () {
    return sz++;
}

bool bfs () {
    fill(d, d + N, -1);
    d[s] = 0;
    queue <int> q; q.push(s);
    while (!q.empty()) {
        int u = q.front(); q.pop();
        for (int i : g[u]) {
            if (e[i].f < e[i].c && d[e[i].v] == -1) {
                d[e[i].v] = d[u] + 1;
                q.push(e[i].v);
            }
        }
    }
    return d[t] != -1;
}

int dfs (int u, int flow) {
    if (u == t) return flow;
    if (flow == 0) return 0;
    for (; ptr[u] < g[u].size(); ++ptr[u]) {
        int i = g[u][ptr[u]];
        if (d[e[i].v] != d[u] + 1) continue;
        int pushed = dfs(e[i].v, min(flow, e[i].c - e[i].f));
        if (pushed != 0) {
            e[i].f += pushed;
            e[i ^ 1].f -= pushed;
            return pushed;
        }
    }
    return 0;
}

int dinic () {
    int res = 0;
    while (bfs()) {
        fill(ptr, ptr + N, 0);
        while (int pushed = dfs(s, inf))
            res += pushed;
    }
    return res;
}

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n, k1, k2;
    cin >> n >> k1 >> k2;
    if (n % 2) {
        cout << "No\n";
        return 0;
    }
    vector <int> tt;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        tt.push_back(a[i]);
    }
    sort(tt.begin(), tt.end());
    tt.erase(unique(tt.begin(), tt.end()), tt.end());
    int p = tt.size();
    cnt.resize(p);
    pos.resize(p);
    auto leap = [&](int x) {
        return (k1 - tt[x] == tt[x] || (k2 ^ tt[x]) == tt[x]);
    };
    vector <pair <int, int>> res;
    auto push_eq_one = [&](int x) {
        res.emplace_back(pos[x][cnt[x] - 1], pos[x][cnt[x] - 2]);
        pos[x].pop_back();
        pos[x].pop_back();
        cnt[x] -= 2;
    };
    auto push_eq = [&](int x) {
        while (cnt[x] > 0) {
            push_eq_one(x);
        }
    };
    auto push_pair = [&](int x, int y) {
        cnt[x]--; cnt[y]--;
        res.push_back({pos[x].back(), pos[y].back()});
        pos[x].pop_back();
        pos[y].pop_back();
    };
    auto get_elem = [&](int x) {
        int j = lower_bound(tt.begin(), tt.end(), x) - tt.begin();
        if (j == tt.size() || tt[j] != x) {
            return -1;
        }
        return j;
    };
    for (int i = 0; i < n; ++i) {
        a[i] = get_elem(a[i]);
        cnt[a[i]]++;
        pos[a[i]].push_back(i);
    }
    if (k2 == 0) {
        for (int i = 0; i < n; ++i) {
            if (cnt[a[i]] == 0) {
                continue;
            }
            if (k1 - tt[a[i]] == tt[a[i]]) {
                if (cnt[a[i]] % 2 != 0) {
                    cout << "No\n";
                    return 0;
                }
                push_eq(a[i]);
            } else {
                int y = get_elem(k1 - tt[a[i]]);
                if (y == -1) {
                    if (cnt[a[i]] % 2 != 0) {
                        cout << "No\n";
                        return 0;
                    }
                    push_eq(a[i]);
                } else {
                    if ((cnt[a[i]] + cnt[y]) % 2 == 0) {
                        if (cnt[a[i]] % 2) {
                            push_pair(a[i], y);
                        }
                        push_eq(a[i]);
                        push_eq(y);
                    } else {
                        cout << "No\n";
                        return 0;
                    }
                }
            }
        }
        cout << "Yes\n";
        for (auto [i, j] : res) {
            cout << i + 1 << ' ' << j + 1 << '\n';
        }
        return 0;
    }
    vector <int> used(p);
    int source = p, sink = p + 1;
    s = source;
    t = sink;
    for (int i = 0; i < p; ++i) {
        if (!used[i]) {
            queue <int> q;
            q.push(i);
            used[i] = 1;
            while (!q.empty()) {
                int j = q.front(); q.pop();
                int y = get_elem(k1 - tt[j]);
                if (y != -1 && !used[y]) {
                    used[y] = 3 - used[j];
                    q.push(y);
                }
                y = get_elem(k2 ^ tt[j]);
                if (y != -1 && !used[y]) {
                    used[y] = 3 - used[j];
                    q.push(y);
                }
            }
        }
        if (used[i] == 1) {
            int y = get_elem(k1 - tt[i]);
            if (y != -1) {
                add(i, y, n);
            }
            y = get_elem(tt[i] ^ k2);
            if (y != -1) {
                add(i, y, n);
            }
        }
    }
    int need = n;
    if (k1 % 2 == 0 && get_elem(k1 / 2) != -1) {
        int x = get_elem(k1 / 2);
        int sum = 0;
        for (int i = 0; i < p; ++i) {
            if (used[i] == 1) {
                sum += cnt[i];
            } else {
                sum -= cnt[i];
            }
        }
        if (sum % 2 != 0) {
            cout << "No\n";
            return 0;
        }
        if ((used[x] == 1 && (sum < 0 || sum - cnt[x] > 0)) || (used[x] == 2 && (sum > 0 || sum + cnt[x] < 0))) {
            cout << "No\n";
            return 0;
        }
        int h = abs(sum) / 2;
        for (int i = 0; i < h; ++i) {
            push_eq_one(x);
        }
        if (used[x] == 1) {
            add(source, x, cnt[x] - 2 * h);
        } else {
            add(x, sink, cnt[x] - 2 * h);
        }
        need -= h * 2;
    }
    for (int i = 0; i < p; ++i) {
        if (tt[i] * 2 == k1) {
            continue;
        }
        if (used[i] == 1) {
            add(source, i, cnt[i]);
        } else {
            add(i, sink, cnt[i]);
        }
    }
    if (dinic() * 2 != need) {
        cout << "No\n";
        return 0;
    }
    cout << "Yes\n";
    for (auto it : e) {
        if (it.c > 0 && it.u < p && it.v < p) {
            while (it.f--)
                push_pair(it.u, it.v);
        }
    }
    for (auto [i, j] : res) {
        cout << i + 1 << ' ' << j + 1 << '\n';
    }
    return 0;
}
