import scala.io.StdIn._
object Main extends App {

  val Array(n, a, b) = readLine.trim.split(' ').map(_.toInt)
  val count = Array.tabulate(1 << n){_.countBit}

  val nums = Array.tabulate(n + 1){_ ⇒ Nil: List[Int]}
  for (i ← 0 until 1 << n if i != a && i != b){
    nums(count(i)) ::= i
  }
  if (a.countBit % 2 == b.countBit % 2) {
    println("NO")
  }else {
    println("YES")
    println(make(n, a, b).mkString(" "))
  }

  def make(n: Int, a: Int, b: Int): List[Int] = {
    if (n == 1) List(a, b)
    else {
      val first = firstDiff(a, b)
      val remA = a.removeBit(first)
      val remB = b.removeBit(first)
      val aBit = a.positionBit(first)
      val bBit = b.positionBit(first)
      if (remA == remB) {
        val diff = remA ^ 1
        val l = make(n - 1, remA, diff)
        l.map(_.insertBit(first, aBit)) ++ l.reverse.map(_.insertBit(first, bBit))
      } else {
        val l = make(n - 1, remA, remA ^ 1)
        val r = make(n - 1, remA ^ 1, remB)
        l.map(_.insertBit(first, aBit)) ++ r.map(_.insertBit(first, bBit))
      }
    }
  }
  def firstDiff(a: Int, b: Int): Int = {
    if (a % 2 != b % 2) 0
    else firstDiff(a / 2, b / 2) + 1
  }
  implicit class WrappedInt(val value: Int) extends AnyVal {
    def countBit: Int = count(value)
    def insertBit(position: Int, bit: Int): Int = (((value >> position << 1) + bit) << position) + (value % (1 << position))
    def positionBit(position: Int): Int = (value >> position) % 2
    def removeBit(position: Int): Int = ((value >> (position + 1)) << position) + (value % (1 << position))
    private [this] def count(value: Int): Int = if (value == 0) 0 else value % 2 + count(value / 2)
  }
}