#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define pc __builtin_popcount

using namespace std;

const int N=2e5+100;
int n,m,w,a,b,lg[N];

int lowbit(int x){return x&-x;}

void solve(int a,int b,int k,int vis){
	if (k==1){printf("%d ",b); return;}
	int x=a^b,c;
	x=lg[lowbit(x)]-1; vis|=1<<x;
	rep (i,0,n-1) if (!(vis>>i&1)){c=a^(1<<i); break;}
	solve(a,c,k-1,vis);
	printf("%d ",c^(1<<x));
	solve(c^(1<<x),b,k-1,vis);
}

int main(){
	scanf("%d%d%d",&n,&a,&b); m=1<<n;
	rep (i,1,m-1) lg[i]=lg[i>>1]+1;
	if (pc(a^b)%2==0) return puts("NO"),0;
	printf("YES\n%d ",a); solve(a,b,n,0);
	return 0;
}