#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl

using namespace std;

template<typename S,typename T>auto&operator<<(ostream&o,pair<S,T>p){return o<<"{"<<p.fi<<","<<p.se<<"}";}
template<typename T>auto&operator<<(ostream&o,set<T>s){for(auto&e:s)o<<e<<" ";return o;}
template<typename S,typename T,typename U>
auto&operator<<(ostream&o,priority_queue<S,T,U>q){while(!q.empty())o<<q.top()<<" ",q.pop();return o;}
template<typename K,typename T>auto&operator<<(ostream&o,map<K,T>m){for(auto&e:m)o<<e<<" ";return o;}
template<typename T>auto&operator<<(ostream&o,vector<T>v){for(auto&e:v)o<<e<<" ";return o;}
void ashow(){}template<typename T,typename...A>void ashow(T t,A...a){cout<<t<<endl;ashow(a...);}

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<P> vp;
typedef vector<double> vd;
typedef vector<string> vs;

const int MAX_N = 100005;

vi dfs(int a, int b, int n){
    vi ans;
    if(n == 1){
        ans.pb(a), ans.pb(b);
        return ans;
    }
    int val = -1;
    int flag = 0;
    rep(i,n){
        if((a>>i&1)^(b>>i&1)){
            if(a>>i&1) flag = 1;
            val = i;
            break;
        }
    }
    int na = 0, nb = 0;
    int hoge = 1;
    rep(i,n){
        if(i == val) continue;
        if(a>>i&1) na += hoge;
        if(b>>i&1) nb += hoge;
        hoge <<= 1;
    }
    int tugi = -1;
    rep(i,(1<<(n-1))){
        if(__builtin_popcount(i) % 2 != __builtin_popcount(na) % 2) tugi = i;
    }
    vi res = dfs(na, tugi, n-1);
    vi res2 = dfs(tugi, nb, n-1);
    each(num, res){
        int hoge = 1;
        int bue = 0;
        rep(i,val){
            if(num>>i&1) bue += hoge;
            hoge <<= 1;
        }
        bue += hoge*flag;
        hoge <<= 1;
        srep(i,val,n-1){
            if(num>>i&1) bue += hoge;
            hoge <<= 1;
        }
        ans.pb(bue);
    }
    each(num, res2){
        int hoge = 1;
        int bue = 0;
        rep(i,val){
            if(num>>i&1) bue += hoge;
            hoge <<= 1;
        }
        bue += hoge*(flag^1);
        hoge <<= 1;
        srep(i,val,n-1){
            if(num>>i&1) bue += hoge;
            hoge <<= 1;
        }
        ans.pb(bue);
    }
    return ans;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, a, b;
    cin >> n >> a >> b;
    if(n == 1){
        cout << "YES\n";
        cout << a << " " << b << "\n";
        return 0;
    }
    if(__builtin_popcount(a) % 2 == __builtin_popcount(b) % 2){
        cout << "NO\n";
        return 0;
    }
    vi res = dfs(a,b,n);
    cout << "YES\n";
    each(val, res){
        cout << val << " ";
    }
    cout << "\n";
    return 0;
}


Measured memory_bytes: 1756