"use strict"
function Main(input){
  input=input.trim().split(/\s+/).map(x=>x-0);
  var N=input.shift();
  var A=input.shift();
  var B=input.shift();
  var toBeChanged=A^B;
  var dist=toBeChanged.toString(2).replace("0","").length;
  if(dist%2===0||dist>Math.pow(2,N)-1){
    console.log("NO");
    return;
  }
  console.log("YES");
  var whereToChange=[];
  var i=0;
  while(toBeChanged>0){
    if(toBeChanged%2===1)whereToChange.push(i);
    toBeChanged=(toBeChanged-toBeChanged%2)/2;
    i++;
  }
//  console.log(whereToChange);
  var ans=[A];
  
  for(let j=1;j<=whereToChange.length;j++){
    ans[j]=ans[j-1]^(Math.pow(2,whereToChange[j-1]));
  }
//  console.log(ans);
  while(ans.length<Math.pow(2,N)){
    ans.push(ans[ans.length-1]^1);
  }
  console.log(ans.join(" "));
}

Main(require("fs").readFileSync("/dev/stdin","utf8"));