#include <bits/stdc++.h>

#ifdef HOME
#define db(x) cerr << #x << " = " << x << endl
#define db3(x, y, z) cerr << "(" << #x << ", " << #y << ", " << #z << ") = (" << x << ", " << y << ", " << z << ")" << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl
#define dbv(a) cerr << #a << " = "; for (auto xxx: a) cerr << xxx  << " "; cerr << endl
#else
#define db(x) ;
#define db3(x, y, z) ;
#define db2(x, y) ;
#define dbv(a) ;
#endif

using namespace std;
typedef long long ll;
typedef double dbl;


const int INF = 1.01e9;
const int MOD = (int)1e9 + 7;

void print(vector<int> a) {
    if (a.empty()) printf("NO\n");
    else {
        printf("YES\n");
        for (int i = 0; i < (int)a.size(); i++) printf("%d%c", a[i], " \n"[i + 1 == (int)a.size()]);
    }
}

vector<int> subsolve(int n, int a, int b, int mask) {
    for (int i = 0; i < n; i++) {
        int bit = (1 << i);
        if ((mask & bit) && (a & bit) == (b & bit)) {
            auto res = subsolve(n, (a & ~bit), (b & ~bit), mask ^ bit);
            int have = a & bit;
            vector<int> nres;
            for (int i = 0; i < (int)res.size(); i += 2) {
                nres.push_back(res[i] ^ have);
                nres.push_back(res[i] ^ have ^ bit);
                nres.push_back(res[i + 1] ^ have ^ bit);
                nres.push_back(res[i + 1] ^ have);
            }
            return nres;
        }
    }

    int active = __builtin_popcount(mask);
    assert(active % 2 == 1);
    if (active == 1) {
        return vector<int>({a, b});
    }
    int b1 = 0;
    while (!((mask >> b1) & 1)) b1++;

    int b2 = b1 + 1;
    while (!((mask >> b2) & 1)) b2++;

    int na = a & ~(1 << b1);
    int nb = b & ~(1 << b1);

    if ((na ^ (1 << b2)) == nb) {
        b2++;
        while (!((mask >> b2) & 1)) b2++;
    }

    auto res1 = subsolve(n, na, na ^ (1 << b2), mask ^ (1 << b1));
    auto res2 = subsolve(n, na ^ (1 << b2), nb, mask ^ (1 << b1));

    int c1 = a & (1 << b1);
    int rc1 = c1 ^ (1 << b1);

    vector<int> res;
    for (int x : res1) res.push_back(x ^ c1);
    for (int x : res2) res.push_back(x ^ rc1);
    return res;
//
//    assert((a & (1 << b1)) != (b & (1 << b1)));
//    assert((a & (1 << b2)) != (b & (1 << b2)));
//
//    auto res = subsolve(n, a & ~(1 << b1) & ~(1 << b2), b & ~(1 << b1) & ~(1 << b2), mask ^ (1 << b1) ^ (1 << b2));
//
//    int c1 = a & (1 << b1);
//    int rc1 = c1 ^ (1 << b1);
//    int c2 = a & (1 << b2);
//    int rc2 = c2 ^ (1 << b2);
//
//    vector<int> nres;
//    for (int i = 0; i < (int)res.size(); i += 2) {
//        nres.push_back(res[i] ^ c1 ^ c2);
//        nres.push_back(res[i] ^ c1 ^ rc2);
//        nres.push_back(res[i] ^ rc1 ^ rc2);
//        nres.push_back(res[i] ^ rc1 ^ c2);
//        nres.push_back(res[i + 1] ^ rc1 ^ c2);
//        nres.push_back(res[i + 1] ^ c1 ^ c2);
//        nres.push_back(res[i + 1] ^ c1 ^ rc2);
//        nres.push_back(res[i + 1] ^ rc1 ^ rc2);
//    }
//    return nres;
}

vector<int> solve(int n, int a, int b) {
    if (__builtin_popcount(a) % 2 == __builtin_popcount(b) % 2) {
        return vector<int>();
    }

    auto res = subsolve(n, a, b, (1 << n) - 1);
    assert(res.size() == (1 << n));
    assert(res[0] == a);
    assert(res.back() == b);
    for (int i = 1; i < (int) res.size(); i++) assert(__builtin_popcount(res[i] ^ res[i - 1]) == 1);
    assert(set<int>(res.begin(), res.end()).size() == (1 << n));
    return res;
}

int main() {
#ifdef HOME
    assert(freopen("in", "r", stdin));
#endif
//    for (int n = 1; n <= 7; n++) {
//        for (int a = 0; a < (1 << n); a++) {
//            for (int b = 0; b <(1 << n); b++) {
//                if (a == b) continue;
//                cout << n << " " << a << " " << b << endl;
//                solve(n, a, b);
//            }
//        }
//    }

    int n, a, b;
    while (cin >> n >> a >> b) {
        print(solve(n, a, b));
    }

#ifdef HOME
    cerr << "time: " << clock() * 1.0 / CLOCKS_PER_SEC << endl;
#endif
}


Measured memory_bytes: 7680