#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;

int n, a, b;
int ans[1 << 18];

vector<int> zero[18];
vector<int> one[18];
vector<int> v, u;
void init(int g,int d) {
	zero[0].push_back(0);
	zero[1].push_back(0); zero[1].push_back(1);
	Rep(i, 2, 18) {
		rep(j, zero[i - 1].size()) {
			zero[i].push_back(zero[i - 1][j]);
		}
		int x = 1 << (i - 1);
		per(j, zero[i - 1].size()) {
			zero[i].push_back(zero[i - 1][j]+x);
		}
	}
	int id = 0;
	one[1].push_back(0);
	rep1(i, zero[d].size()-1) {
		int cur = 0;
		int memm = zero[d][i];
		rep(j, d) {
			if (memm&(1 << j)) {
				cur += (1 << u[j]);
			}
		}
		if (id == 0) {
			one[1].push_back(cur);
			one[1].push_back(cur+(1<<v[0]));
		}
		else {
			one[1].push_back(cur+(1<<v[0]));
			one[1].push_back(cur);
		}
		id ^= 1;
	}
	one[1].push_back((1 << v[0]));
	/*rep(j, one[1].size()) {
		cout << one[1][j] << endl;
	}*/
	id = 0;
	for (int i = 3; i <= g; i += 2) {
		int sk = (1 << v[i - 2]);
		int s = (1 << v[i - 1]);
		int r = 0;
		rep(j, one[i - 2].size()-1) {
			int t = one[i - 2][j];
			if (j == 0) {
				one[i].push_back(t);
				one[i].push_back(t+sk);
				one[i].push_back(t+s+sk);
				one[i].push_back(t+s);
				r ^= s;
			}
			else {
				if (id == 0) {
					one[i].push_back(r^t);
					one[i].push_back(r^(t + s));
					one[i].push_back(r^(t + s + sk));
					one[i].push_back(r^(t + sk));
				}
				else {
					one[i].push_back(r^(t + sk));
					one[i].push_back(r^(t + s + sk));
					one[i].push_back(r^(t + s));
					one[i].push_back(r^t);
				}
				id ^= 1;
			}
		}

		int z = one[i - 2].back(); z ^= r;
		int ssk = (1 << v[i - 3]);
		//one[i].push_back(z);
		one[i].push_back(z);
		one[i].push_back(z^s);
		one[i].push_back(z^s^sk);
		one[i].push_back(z^sk);
		
		/*one[i].push_back(z);
		one[i].push_back(z+s);
		one[i].push_back(z^ssk+s);
		one[i].push_back((z^ssk)+s+sk);
		one[i].push_back(z^ssk+sk);
		one[i].push_back(sk+z);
		one[i].push_back(s+sk+z);*/
	}
	/*rep(i, one[1].size()) {
		cout << one[1][i] << endl;
	}
	cout << "hello" << endl;
	rep(i, one[3].size()) {
		cout << one[3][i] << endl;
	}
	cout << "Hello" << endl;
	rep(i, one[5].size()) {
		cout << one[5][i] << endl;
	}*/
}
int main() {
	cin >> n >> a >> b;
	b ^= a;
	int cnt = 0;
	rep(i, n) {
		if (b&(1 << i)) {
			v.push_back(i);
		}
		else {
			u.push_back(i);
		}
	}
	if (v.size() % 2 == 0) {
		cout << "NO" << endl;
	}
	else {
		cnt = v.size();
		int d = n - cnt;
		init(cnt, d);
		cout << "YES" << endl;
		rep(i, one[cnt].size()) {
			ans[i] = one[cnt][i];
		}
		ans[(1 << n) - 1] = b;
		rep(i, (1 << n)) {
			ans[i] ^= a;
		}
		rep(i, (1 << n)) {
			if (i > 0)cout << " ";
			cout << ans[i];
		}
		cout << endl;
	}
	//stop
	return 0;
}


Measured memory_bytes: 3768