#include <bits/stdc++.h>

using namespace std;

const int N = 5e5 + 1;
int a[N];
int used[N], n, k1, k2;
vector <pair <int, int>> res;

void rec (int i) {
    if (i == n) {
        cout << "Yes\n";
        for (auto [i, j] : res) {
            cout << i + 1 << ' ' << j + 1 << '\n';
        }
        exit(0);
    }
    if (used[i]) {
        rec(i + 1);
    }
    for (int j = i + 1; j < n; ++j) {
        if (!used[j] && (a[i] + a[j] == k1 || (a[i] ^ a[j]) == k2)) {
            res.push_back({i, j});
            used[j] = 1;
            rec(i + 1);
            res.pop_back();
            used[j] = 0;
        }
    }
}

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin >> n >> k1 >> k2;
    if (n % 2) {
        cout << "No\n";
        return 0;
    }
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    rec(0);
    cout << "No\n";
    return 0;
}