//teja349
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

using namespace std;
using namespace __gnu_pbds;

#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
#define flush fflush(stdout) 
#define primeDEN 727999983
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// find_by_order()  // order_of_key
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
int arr[4][8],arr1[4][7];
int boo[4][8];
vi construct(int left){
	if(left==1){
		vi vec;
		vec.pb(0);
		vec.pb(1);
		return vec;
	}
	vi vec=construct(left-2);
	int haha=(1<<(left-2));
	vi vec1;
	int i,j;
	rep(i,vec.size()){
		if(i+1!=vec.size()){
			rep(j,4){
				vec1.pb(vec[i]+haha*arr[i%2][j]);
			}
		}
		else{
			rep(j,4){
				vec1.pb(vec[i]+haha*arr1[i%2][j]);
			}
		}
		
	}
	return vec1;
}
int getbits(int b){
	int ans=0;
	while(b){
		if(b%2)
			ans++;
		b/=2;
	}
	return ans;

}
int fuc[(1<<17)+100][19];
int main(){
    std::ios::sync_with_stdio(false); cin.tie(NULL);
  	int n,a,b;
  	cin>>n>>a>>b;
  	arr[0][0]=0;
  	arr[0][1]=1;
  	arr[0][2]=3;
  	arr[0][3]=2;
  	arr[1][0]=2;
  	arr[1][1]=3;
  	arr[1][2]=1;
  	arr[1][3]=0;
  	arr1[1][0]=2;
  	arr1[1][1]=0;
  	arr1[1][2]=1;
  	arr1[1][3]=3;
  	boo[0][0]=0;
  	boo[0][1]=1;
  	boo[1][0]=1;
  	boo[1][1]=0;
  	
  	b^=a;
  	if(getbits(b)%2==0){
  		cout<<"NO"<<endl;
  		return 0;
  	}
  	else{
  		cout<<"YES"<<endl;
  	}
  	int left=getbits(b);
  	vi vec=construct(left);
  	vi vec1;
  	int i,j,haha,k;
  
  	
    f(i,left,n){
    	haha=1<<(i);
    	vec1.clear();
    	//cout<<"da"<<endl;
    	rep(j,vec.size()){
    		//cout<<vec[j]<<endl;
    		rep(k,2){
    			vec1.pb(vec[j]+haha*boo[j%2][k]);
    		}
    	}
    	vec.clear();
    	rep(j,vec1.size()){
    		vec.pb(vec1[j]);
    	}
    	vec1.clear();
    }
   //  rep(i,vec.size()){
  	// 	cout<<vec[i]<<" ";
  	// }
  	// cout<<endl;
    rep(i,vec.size()){
    	rep(j,n){
    		if(vec[i]&(1<<j))
    			fuc[i][j]=1;
    	}	
    }
    int cur=left-1;
    i=0;
    int b1=b;
    vi bits;
    while(b1){
    	if(b1%2)
    		bits.pb(i);
    	i++;
    	b1/=2;
    }
    fd(i,bits.size()-1,0){
    	rep(j,vec.size()){
    		swap(fuc[j][cur],fuc[j][bits[i]]);
    	}
    	cur--;
    }
    rep(j,vec.size()){
    	vec[j]=0;
    }
    rep(i,n){
    	rep(j,vec.size()){
    		vec[j]+=(1<<i)*fuc[j][i];
    	}
    }
    rep(i,vec.size()){
    	vec[i]^=a;
    	cout<<vec[i]<<" ";
    }
    cout<<endl;
    return 0;   
}


Measured memory_bytes: 12020