#include <bits/stdc++.h>

using namespace std;

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

vector <int> cycle;

void dfs (int u) {
    int f = 1;
    while (f) {
        f = 0;
        used[u] = 1;
        cycle.push_back(u);
        for (int v: g[u]) {
            if (!used[v]) {
                u = v;
                f = 1;
                break;
            }
        }
    }
}

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 t = tt.size();
    g.resize(t);
    cnt.resize(t);
    used.resize(t);
    pos.resize(t);
    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;
    }
    for (int i = 0; i < t; ++i) {
        int y = get_elem(k1 - tt[i]);
        if (y != -1) {
            g[i].push_back(y);
        }
        y = get_elem(tt[i] ^ k2);
        if (y != -1) {
            g[i].push_back(y);
        }
    }
    // bamboos
    for (int i = 0; i < n; ++i) {
        if (used[a[i]])
            continue;
        if (g[a[i]].size() <= 1) {
            cycle.clear();
            dfs(a[i]);
            int k = cycle.size();
            if (k == 1) {
                int x = cycle[0];
                if (leap(x) && cnt[x] % 2 == 0) {
                    push_eq(x);
                    continue;
                } else {
                    cout << "No\n";
                    return 0;
                }
            }
            for (int j = 1; j < k - 1; ++j) {
                if (cnt[cycle[j]] > cnt[cycle[j - 1]] + cnt[cycle[j + 1]]) {
                    cout << "No\n";
                    return 0;
                }
            }
            int x1 = cycle[0];
            int x2 = cycle.back();
            if (leap(x1)) {
                reverse(cycle.begin(), cycle.end());
                swap(x1, x2);
            }
            for (int j = 0; j < k - 1; ++j) {
                if (cnt[cycle[j]] > cnt[cycle[j + 1]]) {
                    cout << "No\n";
                    return 0;
                }
                while (cnt[cycle[j]] > 0) {
                    push_pair(cycle[j], cycle[j + 1]);
                }
            }
            if (!leap(x2) && cnt[cycle.back()] > 0) {
                cout << "No\n";
                return 0;
            }
            if (leap(x2) && cnt[cycle.back()] % 2) {
                cout << "No\n";
                return 0;
            }
            push_eq(x2);
        }
    }
    // cycles
    for (int i = 0; i < n; ++i) {
        if (used[a[i]]) {
            continue;
        }
        cycle.clear();
        dfs(a[i]);
        int k = cycle.size();
        for (int j = 0; j < k; ++j) {
            if (leap(cycle[j])) {
                rotate(cycle.begin(), cycle.begin() + j, cycle.end());
                break;
            }
        }
        int sum = 0;
        for (int j = 0; j < k; ++j) {
            sum += cnt[cycle[j]];
            int s = cnt[cycle[(j - 1 + k) % k]] + cnt[cycle[(j + 1) % k]];
            if (s < cnt[cycle[j]]) {
                cout << "No\n";
                return 0;
            }
        }
        if (sum % 2 == 1) {
            cout << "No\n";
            return 0;
        }
        if (leap(cycle[0])) {
            int s1 = cnt[cycle.back()] + cnt[cycle[1]];
            if ((cnt[cycle[0]] - s1) % 2) {
                cout << "No\n";
                return 0;
            }
            int kk = (cnt[cycle[0]] - s1) / 2;
            int xx = cycle[0];
            while (kk--) {
                cnt[xx] -= 2;
                push_eq_one(xx);
            }
        }
        vector <int> c;
        for (int j = 0; j < k; ++j) {
            c.push_back(cnt[cycle[j]]);
        }
        int ok = -1;
        {
            vector <int> d = c;
            int f = 1;
            for (int l = 0; l < k - 1; ++l) {
                d[l + 1] -= d[l];
            }
            int x = 0, y = c[0];
            for (int l = 0; l < k; ++l) {
                if (l % 2 == 0) {
                    y = min(y, d[l]);
                } else {
                    x = max(x, -d[l]);
                }
            }
            if (x <= y) {
                ok = x;
            }
        }
        if (ok == -1) {
            cout << "No\n";
            return 0;
        }
        for (int j = 0; j < ok; ++j) {
            push_pair(cycle[0], cycle.back());
        }
        for (int j = 0; j < k - 1; ++j) {
            while (cnt[cycle[j]] > 0) {
                push_pair(cycle[j], cycle[j + 1]);
            }
        }
    }
    cout << "Yes\n";
    for (auto [i, j] : res) {
        cout << i + 1 << ' ' << j + 1 << '\n';
    }
    return 0;
}
