#include <bits/stdc++.h>

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int n, S, X;
    std::cin >> n >> S >> X;
    std::map<int, std::vector<int>> forValue;
    std::vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        std::cin >> a[i];
        forValue[a[i]].push_back(i);
    }
    auto isBad = [&](int x) {
        int y = X ^ x;
        if (y == x) {
            return forValue[x].size() % 2 == 1;
        }
        return forValue[x].size() != forValue[y].size();
    };
    std::set<int> badValues;
    for (const auto& it : forValue) {
        if (isBad(it.first)) {
            badValues.insert(it.first);
        }
    }
    std::vector<std::pair<int, int>> ans;
    auto take = [&](int x) {
        if (forValue[x].empty()) {
            std::cout << "No\n";
            exit(0);
        }
        int res = forValue[x].back();
        forValue[x].pop_back();
        return res;
    };
    auto recalc = [&](int x) {
        if (isBad(x)) {
            badValues.insert(x);
        } else {
            badValues.erase(x);
        }
    };
    auto useSum = [&](int x, int y) {
        int i = take(x);
        int j = take(y);
        ans.emplace_back(i, j);
        recalc(x);
        recalc(y);
        recalc(X ^ x);
        recalc(X ^ y); 
    };
    while (!badValues.empty()) {
        int x = *badValues.begin();
        int y = X ^ x;
        if (x != y) {
            assert(forValue[x].size() != forValue[y].size());
            if (forValue[x].size() < forValue[y].size()) {
                useSum(y, S - y);
            } else {
                useSum(x, S - x);
            }
        } else {
            useSum(x, S - x);
        }
    }
    for (int i = 0; i < n; ++i) {
        int x = a[i];
        int y = X ^ x;
        if (x == y) {
            int rest = int(forValue[x].size());
            assert(rest % 2 == 0);
            for (int iter = 0; iter < rest / 2; ++iter) {
                int i = take(x);
                int j = take(x);
                ans.emplace_back(i, j);
            }
        } else {
            assert(forValue[x].size() == forValue[y].size());
            int rest = int(forValue[x].size());
            for (int iter = 0; iter < rest; ++iter) {
                int i = take(x);
                int j = take(y);
                ans.emplace_back(i, j);
            }
        }
    }
    std::cout << "Yes\n";
    for (auto[i, j] : ans) {
        std::cout << i + 1 << " " << j + 1 << "\n";
    }
    return 0;
}