#include <bits/stdc++.h>

using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()

template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

template<typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type
fill_v(T &t, const V &v) { t=v; }
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t, const V &v ) { for(auto &e:t) fill_v(e,v); }

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x: vec) {is >> x;} return is;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
    out<<'['; for(T i: a) {out<<i<<',';} out<<']'; return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    // ll n = 4;
    // vector<ll> v;
    // REP(i, 1<<n) v.push_back(i);
    // sort(ALL(v));

    // do {
    //     bool flag = true;
    //     FOR(i, 1, 1<<n) {
    //         ll tmp = v[i] ^ v[i-1];
    //         if(__builtin_popcount(tmp) != 1) {
    //             flag = false;
    //             break;
    //         }
    //     }
    //     if(flag) {
    //         ll tmp = v[0] ^ v.back();
    //         cout << __builtin_popcount(tmp) << ": ";
    //         REP(i, 1<<n) {
    //             cout << bitset<3>(v[i]) << " ";
    //         }
    //         cout << endl;
    //     }
    // } while(next_permutation(ALL(v)));

    ll n, a, b;
    cin >> n >> a >> b;

    vector<ll> s;
    REP(i, n) {
        vector<ll> tmp(s);
        s.push_back(i);
        for(auto j: tmp) s.push_back(j);
    }
    // cout << s << endl;

    vector<ll> v;
    REP(i, n) {
        if((a&1LL<<i) != (b&1LL<<i)) {
            v.push_back(i);
        }
    }

    // cout << "v=" << v << endl;

    if(v.size()%2 == 0) {
        cout << "NO" << endl;
        return 0;
    }

    for(ll i=(ll)v.size()-2, x=1; i>=1; i-=2, x+=2) {
        // 最後に出てくる x-1 x x-1 の並びをswap
        ll idx1 = -1, idx2 = -1, idx3 = -1;
        for(ll j=(ll)s.size()-1; j>=0; --j) {
            // cout << j << " " << s << endl;
            if(s[j] == x) idx2 = j;
            if(s[j] == x-1) {
                if(idx3 == -1) idx3 = j;
                else if(idx1 == -1) {idx1 = j; break;}
            }
        }
        s[idx1] = s[idx3] = x;
        s[idx2] = x-1;
    }

    // cout << s << endl;

    // [n-1, n-v.size()] がswapされるやつ
    // v[i] がswapしたいやつ
    vector<ll> trans(n, -1);
    ll idx = n-1;
    REP(i, v.size()) {
        trans[idx] = v[i];
        if(idx == n-1) idx=0;
        else idx++;
    }
    vector<ll> v2;
    REP(i, n) {
        bool flag = false;
        REP(j, v.size()) {
            if(v[j] == i) {
                flag = true;
                break;
            }
        }
        if(!flag) v2.push_back(i);
    }
    idx = 0;
    REP(i, n) {
        if(trans[i] != -1) continue;
        trans[i] = v2[idx++];
    }
    // cout << "trans=" << trans << endl;
    REP(i, s.size()) s[i] = trans[s[i]];
    // cout << s << endl;

    vector<bool> used(1LL<<n);
    cout << "YES" << endl;
    ll now = a;
    used[now] = true;
    cout << now;
    REP(i, s.size()) {
        now ^= 1LL<<s[i];
        if(used[now]) assert(false);
        used[now] = true;
        cout << " " << now;
    }
    cout << endl;

    // cout << bitset<9>(b) << endl;
    // cout << bitset<9>(now) << endl;
    // cout << bitset<9>(b ^ now) << endl;

    REP(i, 1LL<<n) {
        if(!used[i]) {
            assert(false);
        }
    }

    return 0;
}


Measured memory_bytes: 2156