//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

namespace n91 {

	using i8 = std::int_least8_t;
	using i32 = std::int_least32_t;
	using i64 = std::int_least64_t;
	using u8 = std::uint_least8_t;
	using u32 = std::uint_least32_t;
	using u64 = std::uint_least64_t;
	using isize = std::ptrdiff_t;
	using usize = std::size_t;

	class rep {
		const usize f, l;

	public:
		class itr {
			friend rep;
			usize i;
			constexpr itr(const usize x) noexcept : i(x) {}

		public:
			void operator++() noexcept { ++i; }
			constexpr usize operator*() const noexcept { return i; }
			constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
		};
		constexpr rep(const usize first, const usize last) noexcept
			: f(first), l(last) {}
		constexpr itr begin() const noexcept { return itr(f); }
		constexpr itr end() const noexcept { return itr(l); }
	};
	class revrep {
		const usize f, l;

	public:
		class itr {
			friend revrep;
			usize i;
			constexpr itr(usize x) noexcept : i(x) {}

		public:
			void operator++() noexcept { --i; }
			constexpr usize operator*() const noexcept { return i; }
			constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
		};
		constexpr revrep(usize first, usize last) noexcept : f(--first), l(--last) {}
		constexpr itr begin() const noexcept { return itr(l); }
		constexpr itr end() const noexcept { return itr(f); }
	};
	template <class T> using vec_alias = std::vector<T>;
	template <class T> auto md_vec(const usize n, const T &value) {
		return std::vector<T>(n, value);
	}
	template <class... Args> auto md_vec(const usize n, Args... args) {
		return std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
	}
	template <class T> constexpr T difference(const T &a, const T &b) {
		return a < b ? b - a : a - b;
	}

} // namespace n91

#include <array>
#include <cstddef>
#include <cstdint>

namespace n91 {

	::std::size_t popcount32(::std::uint_fast32_t c) {
#ifdef __has_builtin
		return __builtin_popcountll(c);
#else
		c = (c & 0x55555555U) + (c >> 1 & 0x55555555U);
		c = (c & 0x33333333U) + (c >> 2 & 0x33333333U);
		c = (c + (c >> 4)) & 0x0F0F0F0FU;
		return static_cast<::std::size_t>(c * 0x01010101U >> 24 & 0x3FU);
#endif
	}


	::std::size_t ctz32(const ::std::uint_fast32_t c) {
#ifdef __has_builtin
		return __builtin_clz(c);
#else
		::std::array<::std::size_t, 32> table = {
			0,  1, 2,  6,  3,  11, 7,  16, 4,  14, 12, 21, 8,  23, 17, 26,
			31, 5, 10, 15, 13, 20, 22, 25, 30, 9,  19, 24, 29, 18, 28, 27 };
		return table[(c & ~c + 1) * 0x4653ADF >> 27 & 0x1F];
#endif
	}


}

#include <algorithm>
#include <iostream>
#include <utility>
#include<string>
#include<array>
#include<numeric>

namespace n91 {

	u32 pop(const usize n) {
		return static_cast<u32>(1) << n;
	}

	bool check(const u32 a, const usize n) {
		return (a&pop(n)) != 0;
	}

	u32 exc(const u32 a,const usize n, const usize m) {
		if (check(a, n) ^ check(a, m)) {
			return a ^ pop(n) ^ pop(m);
		}
		else {
			return a;
		}
	}

	std::vector<u32> solve2(const usize n, const u32 a, const u32 b);

	std::vector<u32> solve(const usize n, const u32 g) {
		const usize s = static_cast<usize>(1) << n;
		const usize lo = ctz32(g);
		if (popcount32(g) == 1) {
			std::vector<u32> ret(s);
			for (const auto i : rep(0, s)) {
				ret[i] = exc(i^(i >> 1), n - 1, lo);
			}
			return std::move(ret);
		}
		std::vector<u32> ret(s / 2);
		for (const auto i : rep(0, s / 2)) {
			ret[i] = i ^ (i >> 1);
		}
		const auto p = solve2(n - 1, pop(n - 2), exc(g, n - 1, lo) ^ pop(n - 1));
		for (const auto e : p) {
			ret.emplace_back(e ^ pop(n - 1));
		}
		for (auto &e : ret) {
			e = exc(e, lo, n - 1);
		}
		return std::move(ret);
	}
	std::vector<u32> solve2(const usize n, const u32 a, const u32 b) {
		auto ret = solve(n, a^b);
		for (auto &e : ret) {
			e ^= a;
		}
		return std::move(ret);
	}

	void main_() {
		usize n;
		u32 a, b;
		std::cin >> n >> a >> b;
		if (popcount32(a^b) % 2 == 0) {
			std::cout << "NO" << std::endl;
			return;
		}
		const auto p = solve2(n, a, b);
		std::cout << "YES" << std::endl;
		for (const auto i : rep(0, p.size())) {
			std::cout << p[i] << " \n"[i + 1 == p.size()];
		}
	}

} // namespace n91

int main() {
	n91::main_();
	return 0;
}


Measured memory_bytes: 1716