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

bitdiff = (a ^ b).to_s(2)

def func(allbits, diffbits)
  return allbits if allbits.size == 1
  p allbits, diffbits
  if diffbits.size == 1
    lr = (allbits - diffbits).inject([]) do |memo, item|
      memo + [item] + memo
    end
    lr + diffbits + lr
  else
    left, right, center = diffbits.each_slice(diffbits.size/2).map(&:itself)
    newallbits = allbits - center
    func(newallbits, left) + center + func(newallbits, right)
  end
end

unless bitdiff.count('1').to_s(2).include?('0')
  puts 'YES'
  ans = []
  diffbits = bitdiff.reverse.each_char.each_with_index.select {|item, index| item == '1'}.map(&:last)
  ans = func((0..(n-1)).to_a, diffbits).inject([a]) do |memo, item|
    memo << (memo.last ^ 2**(item))
  end
  puts ans.join(' ')
else
  puts 'NO'
end
