#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

template<class T> inline T sqr(T x) {return x*x;}

int countbits(int bits)
{
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

VI solve() {
    int n,a,b;
    cin >> n >> a >> b;
    dump(n);
    dump(a);
    dump(b);
    if (countbits(a ^ b) % 2 == 0) {
        cout << "NO" << endl;
        return {};
    }
    cout << "YES" << endl;

    VI graycode(1<<(n-1)), rev(1<<(n-1));
    REP(i,0,1<<(n-1)) {
        graycode[i] = i ^ (i >> 1);
        rev[graycode[i]] = i;
    }

    int au = a>>1, bu = b >> 1, al = a & 1, bl = b & 1;
    bool ltr = al == 0;
    int index = rev[a>>1];

    VI ary;

    while (index != rev[bu]) {
        ary.push_back((graycode[index] << 1) + 1 - ltr);
        ary.push_back((graycode[index] << 1) + ltr);
        ltr = !ltr;
        index = (index + 1) % (1 << (n-1));
    }
    if (au == bu) {
        ary.push_back(a);
        index = (index + 1) % (1 << (n-1));
    }

    while (index != rev[au]) {
        ary.push_back((graycode[index] << 1) + 1 - ltr);
        index = (index + 1) % (1 << (n-1));
    }
    index = (index - 1 + (1 << (n-1))) % (1 << (n-1));
    ltr = !ltr;
    while (index != rev[bu]) {
        ary.push_back((graycode[index] << 1) + 1 - ltr);
        index = (index - 1 + (1 << (n-1))) % (1 << (n-1));
    }
    ary.push_back((graycode[index] << 1) + 1 - ltr);

    return ary;
}

int main() {
    VI ary = solve();
    if (ary.size() > 0) {
        #ifdef LOCAL
        REP (i,0,ary.size()-1) {
            if (countbits(ary[i] ^ ary[i+1]) != 1) {
                cout << i << ": " << ary[i] << "," << ary[i+1] << endl;
            }
        }
        dump(ary[0]);
        dump(ary[ary.size()-1]);
        #else
        for (auto v: ary) cout << v << " ";
        #endif
        cout << endl;
    }
    
    return 0;
}



Measured memory_bytes: 1648