#include<bits/stdc++.h>
#define FOR0(i,n) for(i=0;i<n;i++)
#define FOR(i,j,n) for(i=j;i<n;i++)
#define FORD(i,j,k) for(i=j;i>=k;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 1000000000
#define ninf -1000000000
#define endl '\n' 
#define she_told_me_dont_worry ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
// Use cout.flush() for interactive problems.
// Use this for increased stack size: g++ -o a.exe -Wl,--stack=256000000 -O2 source.cpp
inline long long  MAX2(long long  a, long long int b){return (a)>(b)?(a):(b);}
inline long long  MAX3(long long  a, long long  b,long long  c){return (a)>(b)?((a)>(c)?(a):(c)):((b)>(c)?(b):(c));}
inline long long  MIN2(long long  a, long long  b){return (a)<(b)?(a):(b);}
inline long long  MIN3(long long  a, long long b,long long c){return (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c));}
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< ii > vii;
int main()
{
    she_told_me_dont_worry
    int n, a, b;
    cin>>n>>a>>b;
    int i;
    vi al;
    al.push_back(0);
    al.push_back(1);
    int cur = 1;
    int j;
    if(n==1)
    {
        cout<<"YES"<<endl;
        cout<<a<<" "<<b;
        return 0;
    }
    FOR0(i, n-1)
    {
        int cp = pow(2, cur);
        int cv = pow(2, cur);
        FORD(j, cp-1, 0)
        {
            al.push_back(cv+al[j]);
        }
        cur += 1;
    }
    //cerr<<al.size()<<endl;
    int ap, bp;
    cur = pow(2, n-1);
    //FOR0(i, cur*2) cout<<al[i]<<endl;
    int cura, curb;
    if(a&(1<<(n-1))) cura = a^(1<<(n-1));
    else cura = a;
    if(b&(1<<(n-1))) curb = b^(1<<(n-1));
    else curb = b;
    FOR0(i, cur)
    {
        if(al[i] == cura) ap  = i;
        if(al[i] == curb) bp = i;
    }
    //cout<<cura<<" "<<curb<<endl;
    //cout<<ap<<" "<<bp<<endl;
    int dis = 0;
    int p = pow(2, n-1);
    cur = ap;
    cur++;
    cur %= p;
    while(cur!=bp)
    {
        dis++;
        cur++;
        cur %= p;
    }
    int pa = 0, pb = 0;
    if(cura!=a) pa = 1;
    if(curb!=b) pb = 1;
    //cout<<pa<<" "<<pb<<" "<<dis<<endl;
    if((pa==pb)&&(dis%2==0)||(pa!=pb)&&(dis%2!=0))
    {
        cout<<"YES"<<endl;
        vi out;
        cur = ap;
        int prev;
        if(cura!=a) prev = 1;
        else prev = 0;
        while(cur != bp)
        {
            
            if(prev==1)
            {
                out.push_back(al[cur]^(1<<(n-1)));
                out.push_back(al[cur]);
                prev = 0;
            }
            else 
            {
                out.push_back(al[cur]);
                out.push_back(al[cur]^(1<<(n-1)));
                prev = 1;
            }
            cur++;
            cur %= p;
        }
        if(curb!=b)
        {
            out.push_back(curb);
            prev = 0;
        }
        else
        {
            out.push_back(b^(1<<(n-1)));
            prev = 1;
        }
        cur++;
        cur %= p;
        while(1)
        {
            if(cur==ap) break;
            if(prev)
                out.push_back(al[cur]^(1<<(n-1)));
            else 
                out.push_back(al[cur]);
            cur++;
            cur %= p;
        }
        prev = 1 - prev;
        while(1)
        {
            cur--;
            cur += p;
            cur %= p;
            if(prev)
                out.push_back(al[cur]^(1<<(n-1)));
            else 
                out.push_back(al[cur]);
            if(cur==bp) break;
        }
        int si = out.size();
        FOR0(i, si) cout<<out[i]<<" ";
    }
    else cout<<"NO";
    cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
}

Measured memory_bytes: 2168