#include <bits/stdc++.h>
using namespace std;
bool get(int x, int plc) {
	return ((x >> plc) & 1);
}
vector<int> getAns(int lv, int a, int b) {
	if (lv == 0) {
		vector<int> v;
		v.push_back(a), v.push_back(b);
		return v;
	}
	if (get(a, lv) != get(b, lv)) {
		int c = b ^ (1 << (lv - 1));
		vector<int> fr = getAns(lv - 1, a, c ^ (1 << lv));
		vector<int> sd = getAns(lv - 1, c, b);
		for (auto x : sd)
			fr.push_back(x);
//		cout << "lv = " << lv << " a = " << a << " b = " << b << " : " << endl;
//		for (auto x : fr)
//			cout << x << " ";
//		cout << endl;
		return fr;	
	}
	else {
		vector<int> fr = getAns(lv - 1, a, b), rn;
		for (auto x : fr)
			rn.push_back(x), rn.push_back(x);
		int z = 0;
		for (int i = 1; i < rn.size(); i++) {
			if (i % 2)
				z = 1 - z;
			rn[i] = rn[i] ^ (z << lv);
		}
//		cout << "lv = " << lv << " a = " << a << " b = " << b << endl;
//		for (auto x : fr) 
//			cout << x << " ";
//		cout << endl;
		return rn;
	}
}

int main() {
	int n, a, b;
	cin >> n >> a >> b;
	if (__builtin_popcount(a) % 2 == __builtin_popcount(b) % 2) {
		cout << "NO";
		return 0;
	}		
	cout << "YES\n";
	vector<int> ans = getAns(n - 1, a, b);
	for (auto u : ans)
		cout << u << " ";
	return 0;
}

