def to_bit_array(num)
  result = []
  while num > 0
    result.push(num % 2)
    num = num / 2
  end
  result
end

def array_diff(a, b)
  a.zip(b).map { |ab| ab[0] - ab[1] }
end

def to_int(bit)
  bit.map.with_index { |b, i| b * (2 ** i) }.inject(&:+)
end

n, a, b = gets.chomp.split(' ').map(&:to_i)

a_bit = to_bit_array(a)
b_bit = to_bit_array(b)

if a_bit.length > b_bit.length
  max_len = a_bit.length
  while a_bit.length > b_bit.length
    b_bit.push(0)
  end
else
  max_len = b_bit.length
  while b_bit.length > a_bit.length
    a_bit.push(0)
  end
end

diff = array_diff(a_bit, b_bit)
diff_val = diff.map { |n| n.abs }.inject(&:+)

if diff_val % 2 == 0 || diff_val > (2 ** n) - 1
  puts 'NO'
  exit
end

puts 'YES'

print to_int(a_bit)
count = 0

diff.each.with_index do |bit, i|
  next if bit == 0
  print ' '
  if bit > 0
    a_bit[i] = a_bit[i] - 1
  else
    a_bit[i] = a_bit[i] + 1
  end
  print to_int(a_bit)
  count += 1
end

fin = 2 ** n - 1
while count < fin
  print ' '
  if a_bit[0] > 0
    a_bit[0] = a_bit[0] - 1
  else
    a_bit[0] = a_bit[0] + 1
  end
  print to_int(a_bit)
  count += 1
end