/**
 * @brief ユーザ定義リテラル
 * @author えびちゃん
 */

#ifndef H_int_literals
#define H_int_literals

#include <cstddef>
#include <cstdint>

constexpr intmax_t  operator ""_jd(unsigned long long n) { return n; }
constexpr uintmax_t operator ""_ju(unsigned long long n) { return n; }
constexpr size_t    operator ""_zu(unsigned long long n) { return n; }
constexpr ptrdiff_t operator ""_td(unsigned long long n) { return n; }

#endif  /* !defined(H_int_literals) */

/**
 * @brief ラムダ式の再帰
 * @author えびちゃん
 */

#ifndef H_make_fix_point
#define H_make_fix_point

#include <utility>

template <typename Fn>
class fix_point: Fn {
public:
  explicit constexpr fix_point(Fn&& f) noexcept: Fn(std::forward<Fn>(f)) {}

  template <typename... Args>
  constexpr decltype(auto) operator ()(Args&&... args) const {
    return Fn::operator ()(*this, std::forward<Args>(args)...);
  }
};

template <typename Fn>
static inline constexpr decltype(auto) make_fix_point(Fn&& f) noexcept {
  return fix_point<Fn>{std::forward<Fn>(f)};
}

#endif  /* !defined(H_make_fix_point) */

/**
 * @brief 重みつきグラフの隣接リスト
 * @author えびちゃん
 */

#ifndef H_adjacency_list
#define H_adjacency_list

#include <cstddef>
#include <algorithm>
#include <type_traits>
#include <vector>

template <typename WeightType>
class weighted_edge {
public:
  using size_type = unsigned;
  using weight_type = WeightType;

protected:
  size_type M_src, M_dst;
  weight_type M_weight;

public:
  weighted_edge() = default;
  weighted_edge(weighted_edge const&) = default;
  weighted_edge(weighted_edge&&) = default;

  weighted_edge(size_type s, size_type d, weight_type w):
    M_src(s), M_dst(d), M_weight(w)
  {}

  weighted_edge& operator =(weighted_edge const&) = default;
  weighted_edge& operator =(weighted_edge&&) = default;

  bool operator <(weighted_edge const& other) const {
    if (M_weight < other.M_weight) return true;
    if (other.M_weight < M_weight) return false;
    if (M_src != other.M_src) return M_src < other.M_src;
    return M_dst < other.M_dst;
  }

  size_type source() const { return M_src; }
  size_type target() const { return M_dst; }
  weight_type weight() const { return M_weight; }
};

struct directed_tag {};
struct undirected_tag {};

template <typename Edge, typename Directedness>
class adjacency_list {
public:
  using size_type = unsigned;
  using edge_type = Edge;
  using weight_type = typename Edge::weight_type;

private:
  std::vector<std::vector<edge_type>> M_g;

public:
  adjacency_list() = default;
  adjacency_list(adjacency_list const&) = default;
  adjacency_list(adjacency_list&&) = default;
  explicit adjacency_list(size_type n): M_g(n) {}

  template <typename... Args>
  void emplace(size_type src, size_type dst, Args... args) {
    M_g[src].emplace_back(src, dst, args...);
    if (std::is_same<Directedness, undirected_tag>::value)
      M_g[dst].emplace_back(dst, src, args...);
  }

  void sort_by_index() {
    auto cmp = [](auto const& e1, auto const& e2) {
      return e1.target() < e2.target();
    };
    for (auto v: M_g) std::sort(v.begin(), v.end(), cmp);
  }

  size_type size() const { return M_g.size(); }
  auto const& operator [](size_type i) const { return M_g[i]; }
};

#endif  /* !defined(H_adjacency_list) */

/**
 * @brief 強連結成分分解
 * @author えびちゃん
 */

#ifndef H_strongly_connected_components
#define H_strongly_connected_components

template <typename AdjacencyList>
auto strongly_connected_components(AdjacencyList const& g) {
  size_t n = g.size();
  adjacency_list<weighted_edge<bool>, directed_tag> h(n);
  for (size_t v = 0; v < n; ++v)
    for (auto const& e: g[v]) h.emplace(e.target(), e.source(), 1);

  std::vector<bool> used(n);
  std::vector<size_t> vs;
  auto dfs = make_fix_point([&](auto f, size_t v) -> void {
      used[v] = true;
      for (auto const& e: g[v])
        if (!used[e.target()]) f(e.target());
      vs.push_back(v);
  });
  for (size_t v = 0; v < n; ++v)
    if (!used[v]) dfs(v);

  used.assign(n, false);
  std::vector<unsigned> cmp(n);
  size_t num = 0;
  auto rdfs = make_fix_point([&](auto f, size_t v) -> void {
      used[v] = true;
      cmp[v] = num;
      for (auto const& e: h[v])
        if (!used[e.target()]) f(e.target());
  });
  for (size_t v = vs.size(); v--;)
    if (!used[vs[v]])
      rdfs(vs[v]), ++num;

  return cmp;
}

#endif /* !defined(H_strongly_connected_components) */

#include <cstdio>
#include <vector>

class two_sat {
public:
  using size_type = unsigned;

private:
  size_type M_n;
  adjacency_list<weighted_edge<bool>, directed_tag> M_g;
  std::vector<size_type> M_scc;
  bool M_sat;

  void M_solve() {
    if (!M_scc.empty()) return;
    M_scc = strongly_connected_components(M_g);
    for (size_type i = 0; i < M_n; ++i)
      if (M_scc[i] == M_scc[i+M_n]) {
        M_sat = false;
        return;
      }
    M_sat = true;
  }

public:
  two_sat() = default;
  two_sat(two_sat const&) = default;
  two_sat(two_sat&&) = default;

  two_sat(size_type n): M_n(n), M_g(n+n) {}

  two_sat& operator =(two_sat const&) = default;
  two_sat& operator =(two_sat&&) = default;

  void push(size_type i, bool bi, size_type j, bool bj) {
    M_scc.clear();

    size_type not_i = i + M_n;
    size_type not_j = j + M_n;
    if (!bi) std::swap(i, not_i);
    if (!bj) std::swap(j, not_j);

    // i or j, (not i => j, not j => i)
    M_g.emplace(not_i, j, 1);
    M_g.emplace(not_j, i, 1);
  }

  bool satisfiable() {
    M_solve();
    return M_sat;    
  }

  bool operator [](size_type i) {
    M_solve();
    return M_scc[i+M_n] < M_scc[i];
  }
};

int main() {
  size_t n, x, a, o;
  scanf("%zu %zu %zu %zu", &n, &x, &a, &o);

  if (x == 0) return puts("No"), 0;

  size_t s = n;
  if (~x >> n & 1) {
    for (size_t i = 0; i < n; ++i) {
      if (~x >> i & 1) continue;
      x |= 1_zu << n;
      x &= ~(1_zu << i);
      if ((a >> i & 1) != (a >> n & 1)) {
        a ^= 1_zu << i;
        a ^= 1_zu << n;
      }
      if ((o >> i & 1) != (o >> n & 1)) {
        o ^= 1_zu << i;
        o ^= 1_zu << n;
      }
      s = i;
      break;
    }
  }

  two_sat ts(1_zu << n);

  {
    std::vector<size_t> a0, a1;
    for (size_t i = 0; i <= n; ++i)
      ((a >> i & 1)? a1: a0).push_back(i);

    for (size_t i = 0; i < (1_zu << a0.size()); ++i) {
      size_t ai = a;
      for (size_t k = 0; k < a0.size(); ++k)
        if (i >> k & 1) ai |= 1_zu << a0[k];

      bool bi = false;
      if (ai >> n & 1) {
        bi = true;
        ai ^= x;
      }

      size_t j0 = ~i & ((1_zu << a0.size()) - 1);
      for (size_t j = j0; j; j = j0 & (j-1)) {
        size_t aj = a;
        for (size_t k = 0; k < a0.size(); ++k)
          if (j >> k & 1) aj |= 1_zu << a0[k];

        bool bj = false;
        if (aj >> n & 1) {
          bj = true;
          aj ^= x;
        }

        if (ai <= aj) ts.push(ai, bi, aj, bj);
      }
    }

    if (a >> n & 1) {
      ts.push(a^x, true, a^x, true);
    } else {
      ts.push(a, false, a, false);
    }
  }

  {
    std::vector<size_t> o0, o1;
    for (size_t i = 0; i <= n; ++i)
      ((o >> i & 1)? o1: o0).push_back(i);

    for (size_t i = 0; i < (1_zu << o1.size()); ++i) {
      size_t oi = o;
      for (size_t k = 0; k < o1.size(); ++k)
        if (i >> k & 1) oi ^= 1_zu << o1[k];

      bool bi = false;
      if (oi >> n & 1) {
        bi = true;
        oi ^= x;
      }

      size_t j0 = ~i & ((1_zu << o1.size()) - 1);
      for (size_t j = j0; j; j = j0 & (j-1)) {
        size_t oj = o;
        for (size_t k = 0; k < o1.size(); ++k)
          if (j >> k & 1) oj ^= 1_zu << o1[k];

        bool bj = false;
        if (oj >> n & 1) {
          bj = true;
          oj ^= x;
        }

        if (oi <= oj) ts.push(oi, bi, oj, bj);
      }
    }

    if (o >> n & 1) {
      ts.push(o^x, true, o^x, true);
    } else {
      ts.push(o, false, o, false);
    }
  }

  if (!ts.satisfiable()) return puts("No"), 0;

  std::vector<size_t> res(1_zu << n);
  for (size_t i = 0; i < (1_zu << n); ++i)
    res[i] = (ts[i]? i: i^x);

  if (s != n) {
    for (size_t i = 0; i < (1_zu << n); ++i) {
      size_t& x = res[i];
      if ((x >> n & 1) != (x >> s & 1)) {
        x ^= 1_zu << n;
        x ^= 1_zu << s;
      }
    }
  }

  puts("Yes");
  for (size_t i = 0; i < res.size(); ++i)
    printf("%zu%c", res[i], i+1<res.size()? ' ': '\n');

  return 0;

  if (s != n) {
    if ((a >> s & 1) != (a >> n & 1)) {
      a ^= 1_zu << s;
      a ^= 1_zu << n;
    }
    if ((o >> s & 1) != (o >> n & 1)) {
      o ^= 1_zu << s;
      o ^= 1_zu << n;
    }
    if ((x >> s & 1) != (x >> n & 1)) {
      x ^= 1_zu << s;
      x ^= 1_zu << n;
    }
  }

  bool ok = true;
  for (size_t i = 0; i < res.size(); ++i)
    for (size_t j = 0; j <= i; ++j) {
      if ((res[i] & res[j]) == a) ok = false;
      if ((res[i] | res[j]) == o) ok = false;
      if ((res[i] ^ res[j]) == x) ok = false;
    }

  return !ok;
}



Measured memory_bytes: 354264