#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
//#define ARRAY(type,n) (type *)malloc(sizeof(type)*n)
template<typename T>
T* ARRAY(int n){
	(T*)malloc(sizeof(T)*n);
}
template<typename T>
T** ARRAY2(int m,int n){
	T** type = (T**)malloc(sizeof(T*)*m);
	for(int i=0;i<m;i++){
		type[i]=(T*)malloc(sizeof(T)*n);
	}
	return type;
}
 
/*
* 01 00
* 11 10
*/

//oneは偶数個
//n番目(0~N-1)とn+1番目について操作を行う
//vertual: 111111100000
//とりあえずN=奇数のときだけ考える
//上の階層が条件を満たしていたら、finish = true
void func(int a[], int b[], int N, int n, int vertual[], int now[], int vertualToIndex[], bool finish){

	
	if(n>=N){//最後まで確定
		ll ans = 0;
		bool ok = true;
		rep(i,N){
			ans += ((now[i])^(a[vertualToIndex[i]])) * (ll)(pow(2,N-vertualToIndex[i]-1));
			if(now[i] == 1){
				ok = true;
			}
		}
		if(ok){
			cout<<ans<<" ";
		}
		return;
	}
	if(n==N-1){//nが偶数の時に遭遇
		ll ans = 0;
		bool ok = true;
		rep(i,N){
			ans += ((now[i])^(a[vertualToIndex[i]])) * (ll)(pow(2,N-vertualToIndex[i]-1));
						if(now[i] == 1){
				ok = true;
			}

		}
		if(ok){
			cout<<ans<<" ";
		}
		
		now[n] ^= 1;
		ans = 0;
		rep(i,N){
			ans += ((now[i])^(a[vertualToIndex[i]])) * (ll)(pow(2,N-vertualToIndex[i]-1));
		}
		cout<<ans<<" ";
		return;
	}
	func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
	if(vertual[n] == 0){//0であるべき場所なら
		if(finish){//終わりたいなら
			if(now[n] == 0){//01から反時計回り
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
			}else{
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
			}
		}else{//終わりたくないなら逆回りしとけばとりあえずOK
			if(now[n] == 1){
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
			}else{
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
			}
		}
	}else{//1であるべき場所なら
		if(finish){
			if(now[n] == 1){//0であるべき場所の場合と反対方向に回る
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
			}else{
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
			}
		}else{//終わりたくないなら逆回りしとけばとりあえずOK
			if(now[n] == 0){
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
			}else{
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
				now[n+1] ^= 1;
				func(a,b,N,n+2,vertual,now,vertualToIndex,finish);
			}
		}
	}
	return;
}
 
int main(void){
	ll memoa, memob;
	int n;
	cin>>n>>memoa>>memob;
	int one = 0, zero = 0;//bがaからみてずれてればone++
	int ones[17], zeros[17];
	int a[17], b[17];
	rep(i,n){
		if(memoa%2 == 0){
			a[n-i-1] = 0;
			memoa = memoa / 2;
		}else{
			a[n-i-1] = 1;
			memoa = memoa / 2;
		}
		if(memob%2 == 0){
			b[n-i-1] = 0;
			memob = memob / 2;
		}else{
			b[n-i-1] = 1;
			memob = memob / 2;
		}
		if(a[n-i-1] == b[n-i-1]){
			zero++;
		}else{
			one++;
		}
	}
	int vertual[17];
	int vi=0;
	rep(i,n){
		//oneが3個→ i=0~2がvertual[i] = 1
		if(i < one){
			vertual[i] = 1;
		}else{
			vertual[i] = 0;
		}
	}
	int vertualToIndex[17];
	rep(i,n){
		if((a[i]^b[i]) == 1){
			vertualToIndex[vi] = i;
			vi++;
		}
	}
	rep(i,n){
		if((a[i]^b[i]) == 0){
			vertualToIndex[vi] = i;
			vi++;
		}
	}

	if(one%2 == 0){
		cout<<"NO"<<endl;
		return 0;
	}else{
		cout<<"YES"<<endl;
	}
	int now[17];
	rep(i,n){
		now[i] = 0;
	}
	/*rep(i,n){
		cout<<a[i]<<" ";
	}
	cout<<endl;
	rep(i,n){
		cout<<b[i]<<" ";
	}
	cout<<endl;
	rep(i,n){
		cout<<vertual[i]<<" ";
	}
	cout<<endl;
	rep(i,n){
		cout<<now[i]<<" ";
	}
	cout<<endl;
	rep(i,n){
		cout<<vertualToIndex[i]<<" ";
	}
	cout<<endl;*/
	
	func(a,b,n,1,vertual,now, vertualToIndex, false);
	now[0] = 1;
	func(a,b,n,1,vertual,now, vertualToIndex, true);
	cout<<endl;
	return 0;



}

Measured memory_bytes: 1024