#include <bits/stdc++.h>
template<typename T>
class fixed_point : T {
  public:
    explicit constexpr fixed_point (T&& t) noexcept
      : T(std::forward<T>(t)) {}
    template<typename... Args>
    constexpr decltype(auto) operator()(Args&&... args) const
      {return T::operator()(*this, std::forward<Args>(args)...);}
};
template<typename T>
static inline constexpr decltype(auto) fix (T&& t) noexcept {
  return fixed_point<T>{std::forward<T>(t)};
}
#define LOCAL
using std::to_string;
auto to_string(std::string s) -> std::string {
  return '"' + s + '"';
}
auto to_string(const char* s) -> std::string {
  return to_string((std::string) s);
}
auto to_string(bool b) -> std::string {
  return (b ? "true" : "false");
}
template <typename T, typename U>
auto to_string(std::pair<T, U> p) -> std::string {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename T>
auto to_string(T v) -> std::string {
  bool flg = false;
  std::string res = "{";
  for (auto const&x : v) {
    if (flg) res += ", ";
    else flg = true;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  std::cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) std::cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  // Access the j-th bit.
  auto at = [](unsigned x, size_t j) -> bool {
    return (x >> j) & 1;
  };
  // Remove the j-th bit of x, then shift the upper part to the right.
  auto remove_bit = [](unsigned x, size_t j) -> unsigned {
    return ((x >> (j + 1)) << j) + (x & ((1 << j) - 1));
  };
  // Insert the bit b to x.at(j), shifting the upper part to the left.
  auto insert_bit = [](unsigned x, size_t j, bool b) -> unsigned {
    return ((x >> j) << (j + 1)) + (b << j) + (x & ((1 << j) - 1));
  };
  auto cal = fix ([&](auto cal, size_t n, unsigned a, unsigned b)
    -> std::vector<unsigned> {
    unsigned N = (1 << n);
    assert(0 <= a && a < N);
    assert(0 <= b && b < N);
    assert(__builtin_popcount(a ^ b) % 2 == 1);
    if (n == 1) return {a, b};
    auto j = __builtin_ctz(a ^ b);
    auto aa = at(a, j), bb = at(b, j);
    assert(aa != bb);
    auto A = remove_bit(a, j), B = remove_bit(b, j);
    auto X = [&] () -> unsigned {
      for (unsigned i = 0; i < N / 2; i++) {
        if (i != A && i != B && __builtin_parity(A ^ i)) return i;
      }
      assert(false); return {};
    }();
    assert(__builtin_parity(A ^ X));
    assert(__builtin_parity(B ^ X));
    auto a_seq = cal(n - 1, A, X), b_seq = cal(n - 1, X, B);
    std::for_each(a_seq.begin(), a_seq.end(), [&](auto& x){x = insert_bit(x, j, aa);});
    std::for_each(b_seq.begin(), b_seq.end(), [&](auto& x){x = insert_bit(x, j, bb);});
    a_seq.insert(a_seq.end(), b_seq.begin(), b_seq.end());
    return a_seq;
  });
  size_t n; unsigned a, b;
  std::cin >> n >> a >> b;
  auto err = [&] {
    std::cout << "No" << std::endl;
    exit(0);
  };
  if (__builtin_popcount(a ^ b) % 2 == 0) err();
  std::cout << "Yes" << std::endl;
  auto ret = cal(n, a, b);
  int N = ret.size();
  assert(N == (1 << n));
  assert(ret.front() == a && ret.back() == b);
  for (int i = 0; i < N - 1; i++) {
    assert(__builtin_popcount(ret.at(i) ^ ret.at(i + 1)));
  }
  for (int i = 0; i < N; i++) {
    std::cout << (i > 0 ? " " : "") << ret.at(i);
  }
  std::cout << std::endl;
  return 0;
}

Measured memory_bytes: 1776