#include <bits/stdc++.h>
using namespace std;
void solve(int n, int s, int t, vector<int> & ans)
{
	if(n == 1)
	{
		ans = {s, t};
		return;
	}
	vector<int> l, r;
	int j = __builtin_ctz(s ^ t);
	int mask = (1 << j) - 1;
	int news = (s & mask) ^ ((s >> 1) & (~mask));
	int newt = (t & mask) ^ ((t >> 1) & (~mask)); 
	int mid = news ^ 1;
	solve(n - 1, news, mid, l);
	solve(n - 1, mid, newt, r);
	for(auto v : l)
		ans.push_back((v & mask) ^ ((v & (~mask)) << 1) ^ (s & (1 << j)));
	for(auto v : r)
		ans.push_back((v & mask) ^ ((v & (~mask)) << 1) ^ (t & (1 << j)));
}
int main()
{
	int n, s, t;
	scanf("%d%d%d", &n, &s, &t);
	if(!(__builtin_popcount(s ^ t) & 1))
	{
		puts("NO");
		return 0;
	}
	puts("YES");
	vector<int> ans;
	solve(n, s, t, ans);
	for(int i = 0; i < ans.size(); ++i)
		printf("%d%c", ans[i], i == ans.size() - 1 ? '\n' : ' '); 
	return 0;
}