#include<bits/stdc++.h>
using namespace std;
int n,a,b,sum;
void dfs(int x,int y,int ban){
    if(__builtin_popcount(ban^sum)==1){
        printf("%d %d ",y,x^y);
        return;
    }
    for(int i=0;i<n;i++)
        if((~(ban>>i)&1)&&(x>>i&1))
            for(int j=0;j<n;j++)
                if((~(ban>>j)&1)&&i!=j){
                    dfs(1<<j,y,ban|1<<i);
                    dfs(x^(1<<i)^(1<<j),y^(1<<i)^(1<<j),ban|1<<i);
                    return;
                }
}
int main(){
    scanf("%d%d%d",&n,&a,&b);
    sum=(1<<n)-1;
    if(__builtin_popcount(a^b)&1){
        printf("YES\n");
        dfs(a^b,a,0);
    }
    else
        printf("NO");
    return 0;
}
