#include<bits/stdc++.h>
#define FIO "agc31C"
#define ll long long

const int N=1<<17;

int n,A,B;

#define poly std::vector<int>

inline void out(const poly &a){
  for(int i=0,n=a.size();i<n;i++)printf("%d%c",a[i],i^n-1?' ':'\n');
}

inline poly get(int n,int A,int B){
  poly ret(1<<n);
  //printf("Geting %d %d %d\n",n,A,B);
  if(n==1){
    ret[0]=A;ret[1]=B;
    return ret;
  }
  int pos=0;
  for(;!((A^B)>>pos&1);pos++);
  int tA=A>>(pos+1)<<pos|(A&((1<<pos)-1));
  int tB=B>>(pos+1)<<pos|(B&((1<<pos)-1));
  int C=tA^1;

  //printf("pos=%d\n",pos); printf("tA=%d C=%d tB=%d\n",tA,C,tB);

  poly l=get(n-1,tA,C),r=get(n-1,C,tB);

  for(int i=0;i<1<<n-1;i++){
    ret[i]=(l[i]>>pos)<<(pos+1)|(((A>>pos)&1)<<pos)|(l[i]&((1<<pos)-1));
    ret[i+(1<<n-1)]=(r[i]>>pos)<<(pos+1)|(((B>>pos)&1)<<pos)|(r[i]&((1<<pos)-1));
  }
  return ret;
}

int main(){
  scanf("%d%d%d",&n,&A,&B);
  if(!__builtin_parity(A^B)){
    puts("NO");
  }else{
    puts("YES");
    out(get(n,A,B));
  }
  return 0;
}
