// #includes {{{
#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define LET(x,a) __typeof(a) x(a)
//#define IFOR(i,it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it,++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair

#define EXIST(e,s) ((s).find(e)!=(s).end())

#define RESET(a) memset((a),0,sizeof(a))
#define SET(a) memset((a),-1,sizeof(a))
#define PB push_back
#define DEC(it,command) __typeof(command) it=command

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define debug_v(x) cerr << #x << " = [";REP(__ind,(x).size()){cerr << (x)[__ind] << ", ";}cerr << "] (L" << __LINE__ << ")" << endl;

#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)

typedef long long Int;
typedef unsigned long long uInt;
typedef long double rn;

template<class T>
T inf(){
	return numeric_limits<T>::has_infinity?numeric_limits<T>::infinity():(numeric_limits<T>::max()/2);
}

typedef pair<int,int> pii;

/*
#ifdef MYDEBUG
#include"debug.h"
#include"print.h"
#endif
*/
// }}}

//{{{ io
FILE *file_in=stdin,*file_out=stdout;
#define fin normal_in
#define fout normal_out
//const char fname[]="";
//FILE *fin=fopen(fname,"r"),*fout=fopen(fname,"w");
#ifdef __MINGW32__
#define LLD "%I64d"
#define LLU "%I64u"
#else
#define LLD "%lld"
#define LLU "%llu"
#endif
struct NORMAL_IN{
	bool cnt;
	NORMAL_IN():cnt(true){}
	operator int() const {return cnt;}
#define endl "\n"
	NORMAL_IN& operator>>(int &n){cnt=fscanf(file_in,"%d",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(unsigned int &n){cnt=fscanf(file_in,"%u",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(long long &n){cnt=fscanf(file_in,LLD,&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(unsigned long long &n){cnt=fscanf(file_in,LLU,&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(double &n){cnt=fscanf(file_in,"%lf",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(long double &n){cnt=fscanf(file_in,"%Lf",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(char *c){cnt=fscanf(file_in,"%s",c)!=EOF;return *this;}
	NORMAL_IN& operator>>(string &s){
		s.clear();
		for(bool r=false;;){
			const char c=getchar();
			if(c==EOF){ cnt=false; break;}
			const int t=isspace(c);
			if(!r and !t)r=true;
			if(r){
				if(!t)s.push_back(c);
				else break;
			}
		}
		return *this;
	}
	template<class T>
		NORMAL_IN& operator>>(vector<T> &v){
			int v_size = v.size();
			REP(i,v_size){
				*this>>v[i];
			}
			return *this;
		}
} normal_in;

struct NORMAL_OUT{
	NORMAL_OUT& operator<<(const int &n){fprintf(file_out,"%d",n);return *this;}
	NORMAL_OUT& operator<<(const unsigned int &n){fprintf(file_out,"%u",n);return *this;}
	NORMAL_OUT& operator<<(const long long &n){fprintf(file_out,LLD,n);return *this;}
	NORMAL_OUT& operator<<(const unsigned long long &n){fprintf(file_out,LLU,n);return *this;}
	NORMAL_OUT& operator<<(const double &n){fprintf(file_out,"%lf",n);return *this;}
	NORMAL_OUT& operator<<(const long double &n){fprintf(file_out,"%Lf",n);return *this;}
	NORMAL_OUT& operator<<(const char c[]){fprintf(file_out,"%s",c);return *this;}
	NORMAL_OUT& operator<<(const string &s){fprintf(file_out,"%s",s.c_str());return *this;}
} normal_out;
struct ERR_OUT{
	template<class T>
		ERR_OUT& operator<<(const T &a){
			cerr<<"\x1b[7m"<<a<<"\x1b[m";
			return *this;
		}
} ferr;
//}}}


// 010 -> 001: impossible
// change: a
// not change: b
// a + b = N

const string YES = "YES";
const string NO = "NO";

Int N;
Int A;
Int B;

// start with 00...0, end with 11..1
vector<vector<int> > build_same(int n){
	if(n==0)return {{}};
	auto v = build_same(n-1);
	auto v2 = v;
	reverse(ALL(v2));
	vector<vector<int> > ret;
	for(auto vi:v){
		ret.push_back(vi);
		ret.back().push_back(0);
	}
	for(auto vi:v2){
		ret.push_back(vi);
		ret.back().push_back(1);
	}
	return ret;
}

vector<vector<int> > build_different(int n){
	assert(n%2==1);
	if(n==1)return {{0},{1}};
	auto v = build_different(n-2);
	vector<vector<int> > ret;
	REP(i,v.size()){
		bool end = false;
		if(i==v.size()-1)end = true;
		if(i%2==0){
			{
				auto v2(v[i]);
				v2.push_back(0);v2.push_back(0);
				ret.push_back(v2);
			}
			{
				auto v2(v[i]);
				v2.push_back(0);v2.push_back(1);
				ret.push_back(v2);
			}
			{
				auto v2(v[i]);
				v2.push_back(1);v2.push_back(1);
				ret.push_back(v2);
			}
			{
				auto v2(v[i]);
				v2.push_back(1);v2.push_back(0);
				ret.push_back(v2);
			}
		}else{
			if(end){
				{
					auto v2(v[i]);
					v2.push_back(1);v2.push_back(0);
					ret.push_back(v2);
				}
				{
					auto v2(v[i]);
					v2.push_back(0);v2.push_back(0);
					ret.push_back(v2);
				}
				{
					auto v2(v[i]);
					v2.push_back(0);v2.push_back(1);
					ret.push_back(v2);
				}
				{
					auto v2(v[i]);
					v2.push_back(1);v2.push_back(1);
					ret.push_back(v2);
				}
			}else{
				{
					auto v2(v[i]);
					v2.push_back(1);v2.push_back(0);
					ret.push_back(v2);
				}
				{
					auto v2(v[i]);
					v2.push_back(1);v2.push_back(1);
					ret.push_back(v2);
				}
				{
					auto v2(v[i]);
					v2.push_back(0);v2.push_back(1);
					ret.push_back(v2);
				}
				{
					auto v2(v[i]);
					v2.push_back(0);v2.push_back(0);
					ret.push_back(v2);
				}
			}
		}
	}
	return ret;
}

//000 -> 111
//0 -> 1
//000 -> 001 -> 011 -> 010 -> 110 -> 100 -> 101 -> 111
//0000 -> 0010 -> 0110 -> 0100 -> 1100 -> 1000 -> 1010 -> 1011
//-> 111
// 00 -> 01 -> 11 -> 10
// 10 -> 00 -> 01 -> 11
// 

void check(vector<uint> &ans){
	unordered_set<uint> s;
	for(auto a:ans){
		assert(0<=a and a<(1u<<N));
		assert(s.find(a)==s.end());
		s.insert(a);
	}
	REP(i,ans.size()-1){
		uint t = (ans[i]^ans[i+1]);
		assert(__builtin_popcount(t)==1);
	}
}

void solve(){
	vector<int> base;
	vector<int> diff, same;
	REP(i,N){
		Int b = (1ll<<i);
		if((A&b)!=(B&b))diff.push_back(i);
		else same.push_back(i);
		if(A&b)base.push_back(1);
		else base.push_back(0);
	}
	if(diff.size()%2==0){
		fout<<"NO"<<endl;
		return;
	}
	fout<<"YES"<<endl;
	auto vd = build_different(diff.size()), vs = build_same(same.size());
	vector<uint> ans;
	REP(i,vd.size()){
		REP(j,vs.size()){
			vector<int> v;
			if(i%2==0)v = vs[j];
			else v = vs[vs.size()-1-j];
			uint u = 0;
			REP(j,diff.size()){
				int k = diff[j];
				if(base[k]^vd[i][j]){
					u += (1u<<k);
				}
			}
			REP(j,same.size()){
				int k = same[j];
				if(base[k]^v[j]){
					u += (1u<<k);
				}
			}
			ans.push_back(u);
//			fout<<u<<" ";
		}
	}
//	check(ans);
	REP(i,ans.size()){
		fout<<ans[i];
		if(i<ans.size()-1)fout<<" ";
	}
	fout<<endl;
}

//{{{ main function
int main(){
	fin >> N;
	fin >> A;
	fin >> B;
	solve();
	return 0;
}

//}}}


Measured memory_bytes: 2428