#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(int i=s;i<t;i++)
int co[1<<17],n;
void dfs(int st,int ed,int add,int now,int ban)
{
    if(now==0){
        printf("%d ",st+add);
        return;
    }
    rep(i,0,n)if(((st>>i)&1)!=((ed>>i)&1))
    {
        int k1=(st>>i)&1,k2=(ed>>i)&1;ban+=1<<i;
        st-=k1<<i,ed-=k2<<i;int k=st;
        rep(j,0,n)if(!((ban>>j)&1)){k^=1<<j;break;}
        dfs(st,k,add+(k1<<i),now-1,ban);
        dfs(k,ed,add+(k2<<i),now-1,ban);
        break;
    }
}
int main()
{
    int a,b;
    scanf("%d%d%d",&n,&a,&b);
    rep(i,1,1<<n)co[i]=co[i-(i&(-i))]+1;
    if(!(co[a^b]&1))printf("NO\n");
    else{
        printf("YES\n");
        dfs(a,b,0,n,0);
    }
}