#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
 
using namespace std;
 
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define repl(i,s,n) for(int i=s; i<=n; ++i)
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define ktya(x) sort(all(x))
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 1000000007
#define INFLL 1000000000000000007LL
#define SIZE 200105
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mind(a,b) (a>b?b:a)
#define maxd(a,b) (a>b?a:b)

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD = 1000000007;
//ll MOD=998244353;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;

int N,A,B;
vi difvec,samevec;
int same=0,dif=0;
int calc_num(int x,int y){
	int ret=0;
	rep(i,same){
		if(y%2==1){
			int a=samevec[i];
			ret+=(1<<a);
		}
		y/=2;
	}
	
	rep(i,dif){
		if(x%2==1){
			int a=difvec[i];
			ret+=(1<<a);
		}
		x/=2;
	}
	return ret;
}
int main(){
	cin>>N>>A>>B;
	int a[20],b[20];
	int tempA=A,tempB=B;

	rep(i,18){
		a[i]=tempA%2;
		b[i]=tempB%2;
		tempA/=2;
		tempB/=2;
		if(a[i]!=b[i]){
			dif++;
			difvec.pb(i);
		}else{
			samevec.pb(i);
		}
	}
	//rep(i,dif)cout<<difvec[i]<<endl;
	same=N-dif;
	
	int num=9;
	vi hoge[20];
	hoge[0].pb(0);
	hoge[1].pb(0);
	hoge[1].pb(1);
	int now=1;
	while(num--){
		int base=(1<<now);
		rep(i,hoge[now].size()){
			int now_num=hoge[now][i];
			if(i==0){
				hoge[now+2].pb(now_num);
				hoge[now+2].pb(base*1+now_num);
				hoge[now+2].pb(base*3+now_num);
				hoge[now+2].pb(base*2+now_num);
			}else if(i%2==0){
				hoge[now+2].pb(base*3+now_num);
				hoge[now+2].pb(base*1+now_num);
				hoge[now+2].pb(base*0+now_num);
				hoge[now+2].pb(base*2+now_num);
			}else{
				hoge[now+2].pb(base*2+now_num);
				hoge[now+2].pb(base*0+now_num);
				hoge[now+2].pb(base*1+now_num);
				hoge[now+2].pb(base*3+now_num);
			}
			
			if(i%2==0){
				hoge[now+1].pb(base*0+now_num);
				hoge[now+1].pb(base*1+now_num);
			}else{
				hoge[now+1].pb(base*1+now_num);
				hoge[now+1].pb(base*0+now_num);
			}
		}
		now+=2;
	}
	/*int keta=5;
	rep(i,hoge[keta].size()){
		int x=hoge[keta][i];
		int temp=keta;
		while(temp--){
			cout<<x%2;
			x/=2;
		}
		cout<<endl;
	}*/
	if(dif%2==1){
		cout<<"YES"<<endl;
		vi ans;
		rep(i,hoge[dif].size()){
			int x=hoge[dif][i];
			rep(j,hoge[same].size()){
				int y=hoge[same][j];
				if(i%2==1)y=hoge[same][hoge[same].size()-1-j];
				//cout<<x<<" "<<y<<" "<<calc_num(x,y)<<endl;
				ans.pb(A^calc_num(x,y));
			}
		}
		rep(i,ans.size())cout<<ans[i]<<" ";
		cout<<endl;
		
		int keta=N;
		/*rep(i,ans.size()){
			int x=ans[i];
			int temp=keta;
			
			while(temp--){
				cout<<x%2;
				x/=2;
			}
			cout<<endl;
		}*/
	}else{
		cout<<"NO"<<endl;
		
	}
}

Measured memory_bytes: 6132