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

const int N = (1 << 17);

int n, a, b, ans[N];

void f(int l, int r, int s, int e, int x){
	ans[l] = s;
	ans[r] = e;
	if(l + 1 == r) return;
	int t = (s ^ e) & x;
	int u = t & -t;
	int m = (l + r) / 2;
	int v;
	while(1){
		v = (rand() & x) | (s & ~x);
		if((s ^ v) & u) continue;
		if(__builtin_popcount(s ^ v) % 2 == 0) continue;
		if(__builtin_popcount(e ^ v ^ u) % 2 == 0) continue;
		if(v == e || (v ^ u) == s) continue;
		break;
	}
	f(l, m, s, v, x - u);
	f(m + 1, r, v ^ u, e, x - u);
}

int main(){
	scanf("%d%d%d", &n, &a, &b);
	if(__builtin_popcount(a ^ b) & 1){
		puts("YES");
		f(0, (1 << n) - 1, a, b, (1 << n) - 1);
		for(int i = 0; i < (1 << n); i++) printf("%d ", ans[i]);
		puts("");
	}
	else puts("NO");
}