# include "iostream"
# include "cstdio"
# define Lowbit(x) ((x)&(-(x)))

using namespace std;

int N,S,T;

bool Check(int Now){
	register int Result=0;
	while(Now){
		Result++;
		Now-=Lowbit(Now);
	}
	return Result&1;
}

void Dfs(int A,int B,int Rest){
	if(A==B){
		printf("%d ",A);
		return;
	}
	int lowbit=Lowbit(A^B);
	Rest-=lowbit;
	int Last=Lowbit(Rest);
	Dfs(A,A^Last,Rest);
	Dfs(A^Last^lowbit,B,Rest);
	return;
}

int main(){
	scanf("%d%d%d",&N,&S,&T);
	if(Check(S^T)){
		printf("YES\n");
		Dfs(S,T,(1<<N)-1);
	}else{
		printf("NO\n");
	}
	return 0;
}