N, A, B = gets.strip.split(/ /).collect{|x| x.to_i}

b_list = []
same_list = []
diff_list = []

bit = 1
N.times{|i|
	a = ((A & bit) != 0) ? 1 : 0
	b = ((B & bit) != 0) ? 1 : 0
	b_list << [a == b ? :same : :diff, a, b]
	if a == b
		same_list << i
	else
		diff_list << i
	end
	bit *= 2
}

#p b_list
#p same_list
#p diff_list

if diff_list.length % 2 == 0
	puts "NO"
	exit
else
	first_index = diff_list[0]
	list = b_list[first_index][1] == 0 ? [0, 1 << first_index] : [1 << first_index, 0]
	i = 1
	while i < diff_list.length
		i1 = diff_list[i]
		i2 = diff_list[i + 1]
		new_list = []
		a = b_list[i1][1]
		b = b_list[i2][1]
		zero = (a == 0)
		b1 = (1 << i1)
		b2 = (1 << i2)
		j = 0
		zero = true
		while j < list.length
			x = list[j]
			y = list[j + 1]
			if zero
				new_list << b1 * a +       b2 * b + x
				new_list << b1 * (1 - a) + b2 * b + x
				new_list << b1 * (1 - a) + b2 * (1 - b) + x
				new_list << b1 * a +       b2 * (1 - b) + x
				new_list << b1 * a +       b2 * (1 - b) + y
				new_list << b1 * a +       b2 * b + y
				new_list << b1 * (1 - a) + b2 * b + y
				new_list << b1 * (1 - a) + b2 * (1 - b) + y
			else
				new_list << b1 * (1 - a) + b2 * (1 - b) + x
				new_list << b1 * (1 - a) + b2 * b + x
				new_list << b1 * a +       b2 * b + x
				new_list << b1 * a +       b2 * (1 - b) + x
				new_list << b1 * a +       b2 * (1 - b) + y
				new_list << b1 * (1 - a) + b2 * (1 - b) + y
				new_list << b1 * (1 - a) + b2 * b + y
				new_list << b1 * a +       b2 * b + y
			end
			zero = !zero
			j += 2
		end
		list = new_list
		i += 2
	end
	
	same_list.each{|i|
		a = b_list[i][1]
		bit = (1 << i)
		new_list = []
		zero = (a == 0)
		list.each{|x|
			if zero
				new_list << x
				new_list << (bit | x)
			else
				new_list << (bit | x)
				new_list << x
			end
			zero = !zero
		}
		list = new_list
	}
	puts "YES"
	puts list.join(" ")
end
