#include <bits/stdc++.h>
using namespace std;
int remove(int x, int b){
	int s = (x>>(b + 1));
	int r = (x&((1<<(b)) - 1));
	return (s<<b) + r;
}
int add(int x, int b, int v){
	int s = ((x>>b)<<1) + v;
	int r = (x&((1<<b)-1));
	return (s<<b) + r;
}
vector<int> build(int s, int t, int n){
	if(n == 1) return {s, t};
	int x = 0;
	while(((s>>x)&1) == ((t>>x)&1)) x++;
	int s1 = remove(s, x), s2 = (s>>x)&1;
	int t1 = remove(t, x), t2 = (t>>x)&1;
	int ms = s1 ^ 1;
	vector<int> left = build(s1, ms, n - 1);
	vector<int> right = build(ms, t1, n - 1);
	vector<int> ans;
	for(int v : left) ans.push_back(add(v, x, s2));
	for(int v : right) ans.push_back(add(v, x, t2));
	return ans;
}
int main(){
	int n, a, b; cin >> n >> a >> b;
	if(((__builtin_popcount(a) + __builtin_popcount(b))%2) == 0){
		cout << "NO" << endl;
	} else {
		vector<int> ans = build(a, b, n);
		cout << "YES" << endl;
		for(int v : ans) cout << v << " ";
		cout << endl;
	}
	return 0;
}
