#include <bits/stdc++.h>

// #define DEBUG 1

#define int long long
#define for0(i,n) for (int i=0; i<n; i++)
#define iter(c) for(auto it=c.begin(); it!=c.end(); it++)
#define iter2(c) for(auto it2=c.begin(); it2!=c.end(); it2++)
#define pb push_back
#define ms(a,z) memset(a,z,sizeof(a));
#define mp make_pair
#define X first
#define Y second
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define all(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define pmod(x,m) (((x)%(m)+m)%m)
#ifdef int
#define read(x) scanf("%lld",&x);
#else
#define read(x) scanf("%d",&x);
#endif

#ifdef DEBUG
#define nl cout<<"\n";
#define pr(x) cout<<(x)<<" ";
#define prl(x) cout<<#x " = "<<x<<endl;
#define prp(x) cout<<"("<<(x).first<<" "<<(x).second<<") ";
#define printv(v) {for(int _=0; _<sz(v); _++) cout<<v[_]<<" "; cout<<"\n";}
#define printa(a,s) {for (int _=0; _<s; _++) cout<<a[_]<<" "; cout<<"\n";}
#define print2D(a,m,n) {for (int _=0; _<m; _++) {for (int __=0; __<n; __++) cout<<a[_][__]<<" "; cout<<"\n";} cout<<"\n";}
#define priter(v) iter(v) {pr(*it)} nl
#define debug cout<<"ok at line "<<__LINE__<<endl;
#else
#define nl
#define pr(x)
#define prl(x)
#define prp(x)
#define printv(v)
#define printa(a,s)
#define print2D(a,m,n)
#define priter(v)
#define debug
#endif
#define MAXN 100000

using namespace std;

typedef long long ll;

const int INF = 2147483647;
const long long INFL = 9223372036854775807LL;
const double EPSILON = 0.00000001;
const long long MOD = 1000000007;

pair<int,int> reduce(int a, int b)
{
    for (int d=17; d>=0; d--) {
        if ((a&(1<<d)) == (b&(1<<d))) {
            if ((a&(1<<d)) and (b&(1<<d))) {
                a ^= 1<<d; 
                b ^= 1<<d; 
            }
        }
        else 
            break; 
    }
    return {a,b}; 
}

vector<int> build_path(int a, int b, int lv, int offset)
{
    pr("build_path") pr(a) pr(b) pr(lv) pr(offset) nl 
    // assert(a < (1<<lv)); 
    // assert(b < (1<<lv)); 
    if (a == b) {
        // not possible 
        return vector<int>(); 
    }
    int dif = a^b; 
    int common_lv = 0; 
    for (; dif >= (1<<common_lv); common_lv++) ; 
    
    int aa, bb;
    tie(aa,bb) = reduce(a,b);
    // offset += a - aa; 
    int new_offset = a - aa; 
    bool swapped = false; 
    if (aa > bb) {
        swap(aa,bb);
        swapped = true; 
    }
    pr("reduced to") pr(aa) pr(bb) pr(common_lv) pr(offset+new_offset) nl 
    
    vector<int> path;
    if (common_lv == 1) {
        // base case 
        path.pb(aa + offset+new_offset); 
        path.pb(bb + offset+new_offset); 
    }
    else {
        vector<int> part1 = build_path(aa, aa^1, common_lv-1, offset+new_offset); 
        vector<int> part2 = build_path((aa^1)^(1<<(common_lv-1)), bb, common_lv-1, offset+new_offset); 
        if (part1.empty() or part2.empty())
            return vector<int>(); 
        for (int x : part1)
            path.pb(x);
        for (int x : part2)
            path.pb(x); 
    }    
    
    // nl pr(a) pr(b) nl 
    // printv(path) 
    for (; common_lv < lv; common_lv++) {
        int start = (path[sz(path)-2]-offset) ^ (1<<(common_lv)); 
        int end = (path[sz(path)-1]-offset) ^ (1<<(common_lv)); 
        pr("inserting path") pr(start) pr(end) pr(common_lv) nl 
        vector<int> subpath = build_path(start, end, common_lv, offset); 
        path.insert(path.end()-1, all(subpath)); 
    }
    
    if (swapped) {
        reverse(all(path)); 
    }
    return path; 
}

int32_t main()
{
    #ifdef DEBUG
    //freopen("C.txt","r",stdin);
    //freopen("","w",stdout);
    #endif

    // vector<int> path = build_path(0, 1, 4, 0); 
    // nl 
    // pr("final path:") 
    // printv(path)
    
    int n, a, b; 
    cin >> n >> a >> b; 
    vector<int> path = build_path(a, b, n, 0); 
    if (path.empty()) {
        cout<<"NO"<<endl; 
    }
    else {
        cout<<"YES"<<endl; 
        for (int x : path) {
            printf("%lld ",x);
        }
        printf("\n"); 
    }
    return 0;
}


Measured memory_bytes: 2724