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

int n, a, b, x[1 << 17];

void go(int i, int n, int b){
	if(n == 1){
		x[i] = 0;
		return;
	}
	
	int j = n - 1;
	while((b & (1 << j)) == 0)j--;
	
	b -= 1 << j;
	b += 1 << (n - 1);
	
	int m = (1 << (n - 1)) - 1;
	if(b == (1 << (n - 1))){
		go(i, n - 1, 1);
		x[i + m] = n - 1;
		go(i + m + 1, n - 1, 1);
	}else{
		int c = 1, b0 = 0, b1 = 0;
		for(int i = n - 2; i >= 0; i--)if(b & (1 << i)){
			if(c == 1){
				b0 += 1 << i;
				c = 0;
			}else{
				b1 += 1 << i;
			}
		}
		
		go(i, n - 1, b0);
		x[i + m] = n - 1;
		go(i + m + 1, n - 1, b1);
	}
	
	for(int k = i; k < i + (1 << n) - 1; k++){
		if(x[k] == n - 1)x[k] = j;
		else if(x[k] == j)x[k] = n - 1;
	}
}

int main(){
	scanf("%d %d %d", &n, &a, &b);
	b ^= a;
	
	int c = 0;
	for(int i = 0; i < n; i++)
		if(b & (1 << i))c ^= 1;
		
	if(c == 0){
		printf("NO\n");
		return 0;
	}
	printf("YES\n");
	
	go(0, n, b);
	
	int cur = 0;
	for(int i = 0; i < (1 << n); i++){
		if(i > 0)printf(" ");
		printf("%d", cur ^ a);
		
		if(i + 1 < (1 << n))cur ^= 1 << x[i];
	}
	printf("\n");
	
	return 0;
}
